From fb47a0f545b1e28a739cdb37e8156f4b41ee1a76 Mon Sep 17 00:00:00 2001 From: David Neto Date: Tue, 4 Apr 2023 10:13:10 -0400 Subject: [PATCH 01/23] Avoid a hack in the WGSL lexer This is a non-functioal change. The current rule for delimiters was silly: it should have been a character class range (e.g. [ ... ]). Move delimiter handling into the symbols matcher. --- src/basic-languages/wgsl/wgsl.ts | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/basic-languages/wgsl/wgsl.ts b/src/basic-languages/wgsl/wgsl.ts index 1ed58809..ab3a4822 100644 --- a/src/basic-languages/wgsl/wgsl.ts +++ b/src/basic-languages/wgsl/wgsl.ts @@ -377,7 +377,7 @@ export const language = { predeclared_intrinsics, operators, - symbols: /[!%&*+\-\.\/:;<=>^|_~]+/, + symbols: /[!%&*+\-\.\/:;<=>^|_~,]+/, tokenizer: { root: [ @@ -402,8 +402,6 @@ export const language = { { include: '@commentOrSpace' }, { include: '@numbers' }, - [/;:\./, 'delimiter'], - [/,/, 'delimiter'], // Hack: Should be in previous rule [/[{}()\[\]]/, '@brackets'], ['@', 'annotation', '@attribute'], [ From ba68ad0693e5b845dd86fdbd0a036ff0bd0fc886 Mon Sep 17 00:00:00 2001 From: Henning Dieterichs Date: Thu, 13 Apr 2023 15:51:41 +0200 Subject: [PATCH 02/23] Implements reload command --- website/src/runner/index.ts | 23 ++++++++++++------- website/src/shared.ts | 12 +++++++++- .../pages/playground/PlaygroundModel.ts | 1 - .../src/website/pages/playground/Preview.tsx | 20 ++++++++-------- 4 files changed, 36 insertions(+), 20 deletions(-) diff --git a/website/src/runner/index.ts b/website/src/runner/index.ts index ed1fdd07..fe8af646 100644 --- a/website/src/runner/index.ts +++ b/website/src/runner/index.ts @@ -4,7 +4,7 @@ *--------------------------------------------------------------------------------------------*/ import { loadMonaco } from "../monaco-loader"; -import { IMessage, IPreviewState } from "../shared"; +import { IMessageFromRunner, IMessageToRunner, IPreviewState } from "../shared"; import "./style.scss"; window.addEventListener("message", (event) => { @@ -14,7 +14,7 @@ window.addEventListener("message", (event) => { console.error("not in sandbox"); return; } - const e = event.data as IMessage | { kind: undefined }; + const e = event.data as IMessageToRunner | { kind: undefined }; if (e.kind === "initialize") { initialize(e.state); } else if (e.kind === "update-css") { @@ -64,16 +64,23 @@ async function initialize(state: IPreviewState) { } } -(globalThis as any).bindModelToCodeStr = function bindModel( +function sendMessageToParent(message: IMessageFromRunner) { + window.parent.postMessage(message, "*"); +} + +(globalThis as any).$sendMessageToParent = sendMessageToParent; + +(globalThis as any).$bindModelToCodeStr = function bindModel( model: any, codeStringName: string ) { model.onDidChangeContent(() => { const value = model.getValue(); - window.parent.postMessage( - { kind: "update-code-string", codeStringName, value }, - "*" - ); + sendMessageToParent({ + kind: "update-code-string", + codeStringName, + value, + }); }); }; @@ -91,7 +98,7 @@ function massageJs(js: string) { for (const m of js.matchAll(setFromRegexp)) { const p1 = m[1]; const target = JSON.stringify("set from `" + p1 + "`"); - js += `\n try { globalThis.bindModelToCodeStr(${p1}, ${target}); } catch (e) { console.error(e); }`; + js += `\n try { globalThis.$bindModelToCodeStr(${p1}, ${target}); } catch (e) { console.error(e); }`; } return js; } diff --git a/website/src/shared.ts b/website/src/shared.ts index 71036e39..807b30b7 100644 --- a/website/src/shared.ts +++ b/website/src/shared.ts @@ -5,7 +5,7 @@ import { IMonacoSetup } from "./monaco-loader"; -export type IMessage = +export type IMessageToRunner = | { kind: "initialize"; state: IPreviewState; @@ -15,6 +15,16 @@ export type IMessage = css: string; }; +export type IMessageFromRunner = + | { + kind: "update-code-string"; + codeStringName: string; + value: string; + } + | { + kind: "reload"; + }; + export interface IPlaygroundProject { js: string; css: string; diff --git a/website/src/website/pages/playground/PlaygroundModel.ts b/website/src/website/pages/playground/PlaygroundModel.ts index 85cb1313..de7ec7c3 100644 --- a/website/src/website/pages/playground/PlaygroundModel.ts +++ b/website/src/website/pages/playground/PlaygroundModel.ts @@ -249,7 +249,6 @@ export class PlaygroundModel { escapeRegexpChars(codeStringName) + ":[^\\w`]*`)([^`\\\\]|\\n|\\\\\\\\|\\\\`)*`" ); - debugger; const js = this.js; const str = value.replaceAll("\\", "\\\\").replaceAll("`", "\\`"); const newJs = js.replace(regexp, "$1" + str + "`"); diff --git a/website/src/website/pages/playground/Preview.tsx b/website/src/website/pages/playground/Preview.tsx index a6abdca0..07ee853c 100644 --- a/website/src/website/pages/playground/Preview.tsx +++ b/website/src/website/pages/playground/Preview.tsx @@ -2,7 +2,11 @@ import * as React from "react"; import { IPreviewHandler, PlaygroundModel } from "./PlaygroundModel"; import { observer } from "mobx-react"; import { observable } from "mobx"; -import { IMessage, IPreviewState } from "../../../shared"; +import { + IMessageFromRunner, + IMessageToRunner, + IPreviewState, +} from "../../../shared"; @observer export class Preview @@ -40,7 +44,7 @@ export class Preview return; } - const message: IMessage = { + const message: IMessageToRunner = { kind: "initialize", state: this.currentState, }; @@ -52,15 +56,11 @@ export class Preview if (e.source !== iframe.contentWindow) { return; } - const data = e.data as - | { - kind: "update-code-string"; - codeStringName: string; - value: string; - } - | { kind: "" }; + const data = e.data as IMessageFromRunner; if (data.kind === "update-code-string") { this.props.model.setCodeString(data.codeStringName, data.value); + } else if (data.kind === "reload") { + this.props.model.reload(); } }); }; @@ -83,7 +83,7 @@ export class Preview { kind: "update-css", css: state.css, - } as IMessage, + } as IMessageToRunner, { targetOrigin: "*", } From 7d75202fb56d1dd0b7b6a42cde9f7612503c934e Mon Sep 17 00:00:00 2001 From: Henning Dieterichs Date: Thu, 13 Apr 2023 16:25:34 +0200 Subject: [PATCH 03/23] Escape $ in template strings --- website/src/website/pages/playground/PlaygroundModel.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/website/src/website/pages/playground/PlaygroundModel.ts b/website/src/website/pages/playground/PlaygroundModel.ts index 85cb1313..a4c8f403 100644 --- a/website/src/website/pages/playground/PlaygroundModel.ts +++ b/website/src/website/pages/playground/PlaygroundModel.ts @@ -251,7 +251,10 @@ export class PlaygroundModel { ); debugger; const js = this.js; - const str = value.replaceAll("\\", "\\\\").replaceAll("`", "\\`"); + const str = value + .replaceAll("\\", "\\\\") + .replaceAll("$", "\\$") + .replaceAll("`", "\\`"); const newJs = js.replace(regexp, "$1" + str + "`"); const autoReload = this.settings.autoReload; this.settings.autoReload = false; From e5366f65e8e78f2ec6e7e81b9a1ab0d0921e6f33 Mon Sep 17 00:00:00 2001 From: Sebastian Pahnke Date: Mon, 17 Apr 2023 15:48:13 +0200 Subject: [PATCH 04/23] Add support for private identifiers --- .../javascript/javascript.test.ts | 59 +++++++++++++++++++ .../typescript/typescript.test.ts | 59 +++++++++++++++++++ src/basic-languages/typescript/typescript.ts | 2 +- 3 files changed, 119 insertions(+), 1 deletion(-) diff --git a/src/basic-languages/javascript/javascript.test.ts b/src/basic-languages/javascript/javascript.test.ts index a3566422..88da829f 100644 --- a/src/basic-languages/javascript/javascript.test.ts +++ b/src/basic-languages/javascript/javascript.test.ts @@ -39,6 +39,65 @@ testTokenization('javascript', [ } ], + // identifiers + [ + { + line: 'foo;', + tokens: [ + { startIndex: 0, type: 'identifier.js' }, + { startIndex: 3, type: 'delimiter.js' } + ] + } + ], + + [ + { + line: 'foo() { return 1; }', + tokens: [ + { startIndex: 0, type: 'identifier.js' }, + { startIndex: 3, type: 'delimiter.parenthesis.js' }, + { startIndex: 5, type: '' }, + { startIndex: 6, type: 'delimiter.bracket.js' }, + { startIndex: 7, type: '' }, + { startIndex: 8, type: 'keyword.js' }, + { startIndex: 14, type: '' }, + { startIndex: 15, type: 'number.js' }, + { startIndex: 16, type: 'delimiter.js' }, + { startIndex: 17, type: '' }, + { startIndex: 18, type: 'delimiter.bracket.js' } + ] + } + ], + + [ + { + line: '#foo;', + tokens: [ + { startIndex: 0, type: 'identifier.js' }, + { startIndex: 4, type: 'delimiter.js' } + ] + } + ], + + [ + { + line: '#foo() { return 1; }', + tokens: [ + { startIndex: 0, type: 'identifier.js' }, + { startIndex: 4, type: 'delimiter.parenthesis.js' }, + { startIndex: 6, type: '' }, + { startIndex: 7, type: 'delimiter.bracket.js' }, + { startIndex: 8, type: '' }, + { startIndex: 9, type: 'keyword.js' }, + { startIndex: 15, type: '' }, + { startIndex: 16, type: 'number.js' }, + { startIndex: 17, type: 'delimiter.js' }, + { startIndex: 18, type: '' }, + { startIndex: 19, type: 'delimiter.bracket.js' } + ] + } + ], + // Comments - single line [ { diff --git a/src/basic-languages/typescript/typescript.test.ts b/src/basic-languages/typescript/typescript.test.ts index b2a3400e..363e5c2c 100644 --- a/src/basic-languages/typescript/typescript.test.ts +++ b/src/basic-languages/typescript/typescript.test.ts @@ -39,6 +39,65 @@ testTokenization('typescript', [ } ], + // identifiers + [ + { + line: 'foo;', + tokens: [ + { startIndex: 0, type: 'identifier.ts' }, + { startIndex: 3, type: 'delimiter.ts' } + ] + } + ], + + [ + { + line: 'foo() { return 1; }', + tokens: [ + { startIndex: 0, type: 'identifier.ts' }, + { startIndex: 3, type: 'delimiter.parenthesis.ts' }, + { startIndex: 5, type: '' }, + { startIndex: 6, type: 'delimiter.bracket.ts' }, + { startIndex: 7, type: '' }, + { startIndex: 8, type: 'keyword.ts' }, + { startIndex: 14, type: '' }, + { startIndex: 15, type: 'number.ts' }, + { startIndex: 16, type: 'delimiter.ts' }, + { startIndex: 17, type: '' }, + { startIndex: 18, type: 'delimiter.bracket.ts' } + ] + } + ], + + [ + { + line: '#foo;', + tokens: [ + { startIndex: 0, type: 'identifier.ts' }, + { startIndex: 4, type: 'delimiter.ts' } + ] + } + ], + + [ + { + line: '#foo() { return 1; }', + tokens: [ + { startIndex: 0, type: 'identifier.ts' }, + { startIndex: 4, type: 'delimiter.parenthesis.ts' }, + { startIndex: 6, type: '' }, + { startIndex: 7, type: 'delimiter.bracket.ts' }, + { startIndex: 8, type: '' }, + { startIndex: 9, type: 'keyword.ts' }, + { startIndex: 15, type: '' }, + { startIndex: 16, type: 'number.ts' }, + { startIndex: 17, type: 'delimiter.ts' }, + { startIndex: 18, type: '' }, + { startIndex: 19, type: 'delimiter.bracket.ts' } + ] + } + ], + // Comments - single line [ { diff --git a/src/basic-languages/typescript/typescript.ts b/src/basic-languages/typescript/typescript.ts index e5ca8ff8..317a637f 100644 --- a/src/basic-languages/typescript/typescript.ts +++ b/src/basic-languages/typescript/typescript.ts @@ -227,7 +227,7 @@ export const language = { common: [ // identifiers and keywords [ - /[a-z_$][\w$]*/, + /#?[a-z_$][\w$]*/, { cases: { '@keywords': 'keyword', From d2ec32be72f6eed680ec20c255d371c1afe5b93e Mon Sep 17 00:00:00 2001 From: Sebastian Pahnke Date: Thu, 20 Apr 2023 09:37:00 +0200 Subject: [PATCH 05/23] Add static keyword --- src/basic-languages/javascript/javascript.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/src/basic-languages/javascript/javascript.ts b/src/basic-languages/javascript/javascript.ts index 5ad3bd67..3af6b4f8 100644 --- a/src/basic-languages/javascript/javascript.ts +++ b/src/basic-languages/javascript/javascript.ts @@ -43,6 +43,7 @@ export const language = { 'null', 'return', 'set', + 'static', 'super', 'switch', 'symbol', From c270d67d6da26ab6e77bb60a25894e942d77721e Mon Sep 17 00:00:00 2001 From: Tamas Kiss Date: Thu, 20 Apr 2023 11:24:10 +0000 Subject: [PATCH 06/23] Fix reference error in convert method of OutlineAdapter As the result object is about to be created, it can not be referred to when mapping child items. This fixes #3923 --- src/language/typescript/languageFeatures.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/language/typescript/languageFeatures.ts b/src/language/typescript/languageFeatures.ts index 28e58dda..ca111417 100644 --- a/src/language/typescript/languageFeatures.ts +++ b/src/language/typescript/languageFeatures.ts @@ -890,7 +890,7 @@ export class OutlineAdapter extends Adapter implements languages.DocumentSymbolP range: this._textSpanToRange(model, item.spans[0]), selectionRange: this._textSpanToRange(model, item.spans[0]), tags: [], - children: item.childItems?.map((child) => convert(child, result.name)), + children: item.childItems?.map((child) => convert(child, item.text)), containerName: containerLabel }; return result; From 21df16c2da10d6f659bf1658d1ad11fbf31f0e3a Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 25 Apr 2023 19:06:00 +0000 Subject: [PATCH 07/23] Bump yaml and htmlnano Bumps [yaml](https://github.com/eemeli/yaml) and [htmlnano](https://github.com/posthtml/htmlnano). These dependencies needed to be updated together. Updates `yaml` from 2.2.1 to 2.2.2 - [Release notes](https://github.com/eemeli/yaml/releases) - [Commits](https://github.com/eemeli/yaml/compare/v2.2.1...v2.2.2) Updates `htmlnano` from 2.0.3 to 2.0.4 - [Release notes](https://github.com/posthtml/htmlnano/releases) - [Changelog](https://github.com/posthtml/htmlnano/blob/master/CHANGELOG.md) - [Commits](https://github.com/posthtml/htmlnano/compare/2.0.3...2.0.4) --- updated-dependencies: - dependency-name: yaml dependency-type: indirect - dependency-name: htmlnano dependency-type: indirect ... Signed-off-by: dependabot[bot] --- package-lock.json | 690 +++++++++++++++++++++++++++++++++++----------- 1 file changed, 535 insertions(+), 155 deletions(-) diff --git a/package-lock.json b/package-lock.json index 6702c553..0089fa02 100644 --- a/package-lock.json +++ b/package-lock.json @@ -49,9 +49,9 @@ } }, "node_modules/@babel/code-frame": { - "version": "7.18.6", - "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.18.6.tgz", - "integrity": "sha512-TDCmlK5eOvH+eH7cdAFlNXeVJqWIQ7gW9tY1GJIpUtFb6CmjVyq2VM3u71bOyR8CRihcCgMUYoDNyLXao3+70Q==", + "version": "7.21.4", + "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.21.4.tgz", + "integrity": "sha512-LYvhNKfwWSPpocw8GI7gpK2nq3HSDuEPC/uSYaALSJu9xjsalaaYFOq0Pwt5KmVqwEbZlDu81aLXwBOmD/Fv9g==", "dev": true, "dependencies": { "@babel/highlight": "^7.18.6" @@ -978,6 +978,74 @@ "url": "https://opencollective.com/parcel" } }, + "node_modules/@parcel/optimizer-htmlnano/node_modules/css-select": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/css-select/-/css-select-4.3.0.tgz", + "integrity": "sha512-wPpOYtnsVontu2mODhA19JrqWxNsfdatRKd64kmpRbQgh1KtItko5sTnEpPdpSaJszTOhEMlF/RPz28qj4HqhQ==", + "dev": true, + "dependencies": { + "boolbase": "^1.0.0", + "css-what": "^6.0.1", + "domhandler": "^4.3.1", + "domutils": "^2.8.0", + "nth-check": "^2.0.1" + }, + "funding": { + "url": "https://github.com/sponsors/fb55" + } + }, + "node_modules/@parcel/optimizer-htmlnano/node_modules/css-tree": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/css-tree/-/css-tree-1.1.3.tgz", + "integrity": "sha512-tRpdppF7TRazZrjJ6v3stzv93qxRcSsFmW6cX0Zm2NVKpxE1WV1HblnghVv9TreireHkqI/VDEsfolRF1p6y7Q==", + "dev": true, + "dependencies": { + "mdn-data": "2.0.14", + "source-map": "^0.6.1" + }, + "engines": { + "node": ">=8.0.0" + } + }, + "node_modules/@parcel/optimizer-htmlnano/node_modules/csso": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/csso/-/csso-4.2.0.tgz", + "integrity": "sha512-wvlcdIbf6pwKEk7vHj8/Bkc0B4ylXZruLvOgs9doS5eOsOpuodOV2zJChSpkp+pRpYQLQMeF04nr3Z68Sta9jA==", + "dev": true, + "dependencies": { + "css-tree": "^1.1.2" + }, + "engines": { + "node": ">=8.0.0" + } + }, + "node_modules/@parcel/optimizer-htmlnano/node_modules/mdn-data": { + "version": "2.0.14", + "resolved": "https://registry.npmjs.org/mdn-data/-/mdn-data-2.0.14.tgz", + "integrity": "sha512-dn6wd0uw5GsdswPFfsgMp5NSB0/aDe6fK94YJV/AJDYXL6HVLWBsxeq7js7Ad+mU2K9LAlwpk6kN2D5mwCPVow==", + "dev": true + }, + "node_modules/@parcel/optimizer-htmlnano/node_modules/svgo": { + "version": "2.8.0", + "resolved": "https://registry.npmjs.org/svgo/-/svgo-2.8.0.tgz", + "integrity": "sha512-+N/Q9kV1+F+UeWYoSiULYo4xYSDQlTgb+ayMobAXPwMnLvop7oxKMo9OzIrX5x3eS4L4f2UHhc9axXwY8DpChg==", + "dev": true, + "dependencies": { + "@trysound/sax": "0.2.0", + "commander": "^7.2.0", + "css-select": "^4.1.3", + "css-tree": "^1.1.3", + "csso": "^4.2.0", + "picocolors": "^1.0.0", + "stable": "^0.1.8" + }, + "bin": { + "svgo": "bin/svgo" + }, + "engines": { + "node": ">=10.13.0" + } + }, "node_modules/@parcel/optimizer-image": { "version": "2.8.1", "resolved": "https://registry.npmjs.org/@parcel/optimizer-image/-/optimizer-image-2.8.1.tgz", @@ -1019,6 +1087,74 @@ "url": "https://opencollective.com/parcel" } }, + "node_modules/@parcel/optimizer-svgo/node_modules/css-select": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/css-select/-/css-select-4.3.0.tgz", + "integrity": "sha512-wPpOYtnsVontu2mODhA19JrqWxNsfdatRKd64kmpRbQgh1KtItko5sTnEpPdpSaJszTOhEMlF/RPz28qj4HqhQ==", + "dev": true, + "dependencies": { + "boolbase": "^1.0.0", + "css-what": "^6.0.1", + "domhandler": "^4.3.1", + "domutils": "^2.8.0", + "nth-check": "^2.0.1" + }, + "funding": { + "url": "https://github.com/sponsors/fb55" + } + }, + "node_modules/@parcel/optimizer-svgo/node_modules/css-tree": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/css-tree/-/css-tree-1.1.3.tgz", + "integrity": "sha512-tRpdppF7TRazZrjJ6v3stzv93qxRcSsFmW6cX0Zm2NVKpxE1WV1HblnghVv9TreireHkqI/VDEsfolRF1p6y7Q==", + "dev": true, + "dependencies": { + "mdn-data": "2.0.14", + "source-map": "^0.6.1" + }, + "engines": { + "node": ">=8.0.0" + } + }, + "node_modules/@parcel/optimizer-svgo/node_modules/csso": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/csso/-/csso-4.2.0.tgz", + "integrity": "sha512-wvlcdIbf6pwKEk7vHj8/Bkc0B4ylXZruLvOgs9doS5eOsOpuodOV2zJChSpkp+pRpYQLQMeF04nr3Z68Sta9jA==", + "dev": true, + "dependencies": { + "css-tree": "^1.1.2" + }, + "engines": { + "node": ">=8.0.0" + } + }, + "node_modules/@parcel/optimizer-svgo/node_modules/mdn-data": { + "version": "2.0.14", + "resolved": "https://registry.npmjs.org/mdn-data/-/mdn-data-2.0.14.tgz", + "integrity": "sha512-dn6wd0uw5GsdswPFfsgMp5NSB0/aDe6fK94YJV/AJDYXL6HVLWBsxeq7js7Ad+mU2K9LAlwpk6kN2D5mwCPVow==", + "dev": true + }, + "node_modules/@parcel/optimizer-svgo/node_modules/svgo": { + "version": "2.8.0", + "resolved": "https://registry.npmjs.org/svgo/-/svgo-2.8.0.tgz", + "integrity": "sha512-+N/Q9kV1+F+UeWYoSiULYo4xYSDQlTgb+ayMobAXPwMnLvop7oxKMo9OzIrX5x3eS4L4f2UHhc9axXwY8DpChg==", + "dev": true, + "dependencies": { + "@trysound/sax": "0.2.0", + "commander": "^7.2.0", + "css-select": "^4.1.3", + "css-tree": "^1.1.3", + "csso": "^4.2.0", + "picocolors": "^1.0.0", + "stable": "^0.1.8" + }, + "bin": { + "svgo": "bin/svgo" + }, + "engines": { + "node": ">=10.13.0" + } + }, "node_modules/@parcel/optimizer-terser": { "version": "2.8.1", "resolved": "https://registry.npmjs.org/@parcel/optimizer-terser/-/optimizer-terser-2.8.1.tgz", @@ -1826,12 +1962,6 @@ "integrity": "sha512-93+VvleD3mXwlLI/xASjw0FzKcwzl3OdTCzm1LaRfqgS21gfFtK3zDXM5Op9TeeMsJVOaJ2VRDpT9q4Y3d0AvA==", "dev": true }, - "node_modules/@types/parse-json": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/@types/parse-json/-/parse-json-4.0.0.tgz", - "integrity": "sha512-//oorEZjL6sbPcKUaCdIGlIUeH26mgzimjBB77G6XRgnDl/L5wOnpyBGRe/Mmf5CVW3PwEBE1NjiMZ/ssFh4wA==", - "dev": true - }, "node_modules/@types/shelljs": { "version": "0.8.11", "resolved": "https://registry.npmjs.org/@types/shelljs/-/shelljs-0.8.11.tgz", @@ -2559,6 +2689,15 @@ "node": ">= 0.8" } }, + "node_modules/commander": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/commander/-/commander-7.2.0.tgz", + "integrity": "sha512-QrWXB+ZQSVPmIWIhtEO9H+gwHaMGYiF5ChvoJ+K9ZGHG/sVsa6yiesAD1GC/x46sET00Xlwo1u49RVVVzvcSkw==", + "dev": true, + "engines": { + "node": ">= 10" + } + }, "node_modules/concat-map": { "version": "0.0.1", "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", @@ -2575,19 +2714,21 @@ } }, "node_modules/cosmiconfig": { - "version": "7.1.0", - "resolved": "https://registry.npmjs.org/cosmiconfig/-/cosmiconfig-7.1.0.tgz", - "integrity": "sha512-AdmX6xUzdNASswsFtmwSt7Vj8po9IuqXm0UXz7QKPuEUmPB4XyjGfaAr2PSuELMwkRMVH1EpIkX5bTZGRB3eCA==", + "version": "8.1.3", + "resolved": "https://registry.npmjs.org/cosmiconfig/-/cosmiconfig-8.1.3.tgz", + "integrity": "sha512-/UkO2JKI18b5jVMJUp0lvKFMpa/Gye+ZgZjKD+DGEN9y7NRcf/nK1A0sp67ONmKtnDCNMS44E6jrk0Yc3bDuUw==", "dev": true, "dependencies": { - "@types/parse-json": "^4.0.0", "import-fresh": "^3.2.1", + "js-yaml": "^4.1.0", "parse-json": "^5.0.0", - "path-type": "^4.0.0", - "yaml": "^1.10.0" + "path-type": "^4.0.0" }, "engines": { - "node": ">=10" + "node": ">=14" + }, + "funding": { + "url": "https://github.com/sponsors/d-fischer" } }, "node_modules/create-require": { @@ -2637,32 +2778,99 @@ } }, "node_modules/css-select": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/css-select/-/css-select-4.3.0.tgz", - "integrity": "sha512-wPpOYtnsVontu2mODhA19JrqWxNsfdatRKd64kmpRbQgh1KtItko5sTnEpPdpSaJszTOhEMlF/RPz28qj4HqhQ==", + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/css-select/-/css-select-5.1.0.tgz", + "integrity": "sha512-nwoRF1rvRRnnCqqY7updORDsuqKzqYJ28+oSMaJMMgOauh3fvwHqMS7EZpIPqK8GL+g9mKxF1vP/ZjSeNjEVHg==", "dev": true, + "optional": true, + "peer": true, "dependencies": { "boolbase": "^1.0.0", - "css-what": "^6.0.1", - "domhandler": "^4.3.1", - "domutils": "^2.8.0", + "css-what": "^6.1.0", + "domhandler": "^5.0.2", + "domutils": "^3.0.1", "nth-check": "^2.0.1" }, "funding": { "url": "https://github.com/sponsors/fb55" } }, - "node_modules/css-tree": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/css-tree/-/css-tree-1.1.3.tgz", - "integrity": "sha512-tRpdppF7TRazZrjJ6v3stzv93qxRcSsFmW6cX0Zm2NVKpxE1WV1HblnghVv9TreireHkqI/VDEsfolRF1p6y7Q==", + "node_modules/css-select/node_modules/dom-serializer": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/dom-serializer/-/dom-serializer-2.0.0.tgz", + "integrity": "sha512-wIkAryiqt/nV5EQKqQpo3SToSOV9J0DnbJqwK7Wv/Trc92zIAYZ4FlMu+JPFW1DfGFt81ZTCGgDEabffXeLyJg==", "dev": true, + "optional": true, + "peer": true, "dependencies": { - "mdn-data": "2.0.14", - "source-map": "^0.6.1" + "domelementtype": "^2.3.0", + "domhandler": "^5.0.2", + "entities": "^4.2.0" + }, + "funding": { + "url": "https://github.com/cheeriojs/dom-serializer?sponsor=1" + } + }, + "node_modules/css-select/node_modules/domhandler": { + "version": "5.0.3", + "resolved": "https://registry.npmjs.org/domhandler/-/domhandler-5.0.3.tgz", + "integrity": "sha512-cgwlv/1iFQiFnU96XXgROh8xTeetsnJiDsTc7TYCLFd9+/WNkIqPTxiM/8pSd8VIrhXGTf1Ny1q1hquVqDJB5w==", + "dev": true, + "optional": true, + "peer": true, + "dependencies": { + "domelementtype": "^2.3.0" }, "engines": { - "node": ">=8.0.0" + "node": ">= 4" + }, + "funding": { + "url": "https://github.com/fb55/domhandler?sponsor=1" + } + }, + "node_modules/css-select/node_modules/domutils": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/domutils/-/domutils-3.0.1.tgz", + "integrity": "sha512-z08c1l761iKhDFtfXO04C7kTdPBLi41zwOZl00WS8b5eiaebNpY00HKbztwBq+e3vyqWNwWF3mP9YLUeqIrF+Q==", + "dev": true, + "optional": true, + "peer": true, + "dependencies": { + "dom-serializer": "^2.0.0", + "domelementtype": "^2.3.0", + "domhandler": "^5.0.1" + }, + "funding": { + "url": "https://github.com/fb55/domutils?sponsor=1" + } + }, + "node_modules/css-select/node_modules/entities": { + "version": "4.5.0", + "resolved": "https://registry.npmjs.org/entities/-/entities-4.5.0.tgz", + "integrity": "sha512-V0hjH4dGPh9Ao5p0MoRY6BVqtwCjhz6vI5LT8AJ55H+4g9/4vbHx1I54fS0XuclLhDHArPQCiMjDxjaL8fPxhw==", + "dev": true, + "optional": true, + "peer": true, + "engines": { + "node": ">=0.12" + }, + "funding": { + "url": "https://github.com/fb55/entities?sponsor=1" + } + }, + "node_modules/css-tree": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/css-tree/-/css-tree-2.3.1.tgz", + "integrity": "sha512-6Fv1DV/TYw//QF5IzQdqsNDjx/wc8TrMBZsqjL9eW01tWb7R7k/mq+/VXfJCl7SoD5emsJop9cOByJZfs8hYIw==", + "dev": true, + "optional": true, + "peer": true, + "dependencies": { + "mdn-data": "2.0.30", + "source-map-js": "^1.0.1" + }, + "engines": { + "node": "^10 || ^12.20.0 || ^14.13.0 || >=15.0.0" } }, "node_modules/css-what": { @@ -2690,17 +2898,44 @@ } }, "node_modules/csso": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/csso/-/csso-4.2.0.tgz", - "integrity": "sha512-wvlcdIbf6pwKEk7vHj8/Bkc0B4ylXZruLvOgs9doS5eOsOpuodOV2zJChSpkp+pRpYQLQMeF04nr3Z68Sta9jA==", + "version": "5.0.5", + "resolved": "https://registry.npmjs.org/csso/-/csso-5.0.5.tgz", + "integrity": "sha512-0LrrStPOdJj+SPCCrGhzryycLjwcgUSHBtxNA8aIDxf0GLsRh1cKYhB00Gd1lDOS4yGH69+SNn13+TWbVHETFQ==", "dev": true, + "optional": true, + "peer": true, "dependencies": { - "css-tree": "^1.1.2" + "css-tree": "~2.2.0" }, "engines": { - "node": ">=8.0.0" + "node": "^10 || ^12.20.0 || ^14.13.0 || >=15.0.0", + "npm": ">=7.0.0" } }, + "node_modules/csso/node_modules/css-tree": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/css-tree/-/css-tree-2.2.1.tgz", + "integrity": "sha512-OA0mILzGc1kCOCSJerOeqDxDQ4HOh+G8NbOJFOTgOCzpw7fCBubk0fEyxp8AgOL/jvLgYA/uV0cMbe43ElF1JA==", + "dev": true, + "optional": true, + "peer": true, + "dependencies": { + "mdn-data": "2.0.28", + "source-map-js": "^1.0.1" + }, + "engines": { + "node": "^10 || ^12.20.0 || ^14.13.0 || >=15.0.0", + "npm": ">=7.0.0" + } + }, + "node_modules/csso/node_modules/mdn-data": { + "version": "2.0.28", + "resolved": "https://registry.npmjs.org/mdn-data/-/mdn-data-2.0.28.tgz", + "integrity": "sha512-aylIc7Z9y4yzHYAJNuESG3hfhC+0Ibp/MAMiaOZgNv4pmEdFyfZhhhny4MNiAfWdBQ1RQ2mfDWmM1x8SvGyp8g==", + "dev": true, + "optional": true, + "peer": true + }, "node_modules/cssom": { "version": "0.5.0", "resolved": "https://registry.npmjs.org/cssom/-/cssom-0.5.0.tgz", @@ -4114,22 +4349,22 @@ } }, "node_modules/htmlnano": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/htmlnano/-/htmlnano-2.0.3.tgz", - "integrity": "sha512-S4PGGj9RbdgW8LhbILNK7W9JhmYP8zmDY7KDV/8eCiJBQJlbmltp5I0gv8c5ntLljfdxxfmJ+UJVSqyH4mb41A==", + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/htmlnano/-/htmlnano-2.0.4.tgz", + "integrity": "sha512-WGCkyGFwjKW1GeCBsPYacMvaMnZtFJ0zIRnC2NCddkA+IOEhTqskXrS7lep+3yYZw/nQ3dW1UAX4yA/GJyR8BA==", "dev": true, "dependencies": { - "cosmiconfig": "^7.0.1", + "cosmiconfig": "^8.0.0", "posthtml": "^0.16.5", "timsort": "^0.3.0" }, "peerDependencies": { - "cssnano": "^5.0.11", + "cssnano": "^6.0.0", "postcss": "^8.3.11", "purgecss": "^5.0.0", "relateurl": "^0.2.7", "srcset": "4.0.0", - "svgo": "^2.8.0", + "svgo": "^3.0.2", "terser": "^5.10.0", "uncss": "^0.17.3" }, @@ -4930,10 +5165,12 @@ } }, "node_modules/mdn-data": { - "version": "2.0.14", - "resolved": "https://registry.npmjs.org/mdn-data/-/mdn-data-2.0.14.tgz", - "integrity": "sha512-dn6wd0uw5GsdswPFfsgMp5NSB0/aDe6fK94YJV/AJDYXL6HVLWBsxeq7js7Ad+mU2K9LAlwpk6kN2D5mwCPVow==", - "dev": true + "version": "2.0.30", + "resolved": "https://registry.npmjs.org/mdn-data/-/mdn-data-2.0.30.tgz", + "integrity": "sha512-GaqWWShW4kv/G9IEucWScBx9G1/vsFZZJUO+tD26M8J8z3Kw5RDQjaoZe03YAClgeS/SWPOcb4nkFBTEi5DUEA==", + "dev": true, + "optional": true, + "peer": true }, "node_modules/merge-stream": { "version": "2.0.0", @@ -5431,15 +5668,6 @@ "url": "https://opencollective.com/parcel" } }, - "node_modules/parcel/node_modules/commander": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/commander/-/commander-7.2.0.tgz", - "integrity": "sha512-QrWXB+ZQSVPmIWIhtEO9H+gwHaMGYiF5ChvoJ+K9ZGHG/sVsa6yiesAD1GC/x46sET00Xlwo1u49RVVVzvcSkw==", - "dev": true, - "engines": { - "node": ">= 10" - } - }, "node_modules/parent-module": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/parent-module/-/parent-module-1.0.1.tgz", @@ -5570,15 +5798,6 @@ "node": "^12.20.0 || >=14" } }, - "node_modules/pin-github-action/node_modules/yaml": { - "version": "2.2.1", - "resolved": "https://registry.npmjs.org/yaml/-/yaml-2.2.1.tgz", - "integrity": "sha512-e0WHiYql7+9wr4cWMx3TVQrNwejKaEe7/rHNmQmqRjazfOP5W8PB6Jpebb5o6fIapbz9o9+2ipcaTM2ZwDI6lw==", - "dev": true, - "engines": { - "node": ">= 14" - } - }, "node_modules/playwright": { "version": "1.32.2", "resolved": "https://registry.npmjs.org/playwright/-/playwright-1.32.2.tgz", @@ -6347,33 +6566,29 @@ } }, "node_modules/svgo": { - "version": "2.8.0", - "resolved": "https://registry.npmjs.org/svgo/-/svgo-2.8.0.tgz", - "integrity": "sha512-+N/Q9kV1+F+UeWYoSiULYo4xYSDQlTgb+ayMobAXPwMnLvop7oxKMo9OzIrX5x3eS4L4f2UHhc9axXwY8DpChg==", + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/svgo/-/svgo-3.0.2.tgz", + "integrity": "sha512-Z706C1U2pb1+JGP48fbazf3KxHrWOsLme6Rv7imFBn5EnuanDW1GPaA/P1/dvObE670JDePC3mnj0k0B7P0jjQ==", "dev": true, + "optional": true, + "peer": true, "dependencies": { "@trysound/sax": "0.2.0", "commander": "^7.2.0", - "css-select": "^4.1.3", - "css-tree": "^1.1.3", - "csso": "^4.2.0", - "picocolors": "^1.0.0", - "stable": "^0.1.8" + "css-select": "^5.1.0", + "css-tree": "^2.2.1", + "csso": "^5.0.5", + "picocolors": "^1.0.0" }, "bin": { "svgo": "bin/svgo" }, "engines": { - "node": ">=10.13.0" - } - }, - "node_modules/svgo/node_modules/commander": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/commander/-/commander-7.2.0.tgz", - "integrity": "sha512-QrWXB+ZQSVPmIWIhtEO9H+gwHaMGYiF5ChvoJ+K9ZGHG/sVsa6yiesAD1GC/x46sET00Xlwo1u49RVVVzvcSkw==", - "dev": true, - "engines": { - "node": ">= 10" + "node": ">=14.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/svgo" } }, "node_modules/symbol-tree": { @@ -7125,12 +7340,12 @@ "dev": true }, "node_modules/yaml": { - "version": "1.10.2", - "resolved": "https://registry.npmjs.org/yaml/-/yaml-1.10.2.tgz", - "integrity": "sha512-r3vXyErRCYJ7wg28yvBY5VSoAF8ZvlcW9/BwUzEtUsjvX/DKs24dIkuwjtuprwJJHsbyUbLApepYTR1BN4uHrg==", + "version": "2.2.2", + "resolved": "https://registry.npmjs.org/yaml/-/yaml-2.2.2.tgz", + "integrity": "sha512-CBKFWExMn46Foo4cldiChEzn7S7SRV+wqiluAb6xmueD/fGyRHIhX8m14vVGgeFWjN540nKCNVj6P21eQjgTuA==", "dev": true, "engines": { - "node": ">= 6" + "node": ">= 14" } }, "node_modules/yargs": { @@ -7208,9 +7423,9 @@ }, "dependencies": { "@babel/code-frame": { - "version": "7.18.6", - "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.18.6.tgz", - "integrity": "sha512-TDCmlK5eOvH+eH7cdAFlNXeVJqWIQ7gW9tY1GJIpUtFb6CmjVyq2VM3u71bOyR8CRihcCgMUYoDNyLXao3+70Q==", + "version": "7.21.4", + "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.21.4.tgz", + "integrity": "sha512-LYvhNKfwWSPpocw8GI7gpK2nq3HSDuEPC/uSYaALSJu9xjsalaaYFOq0Pwt5KmVqwEbZlDu81aLXwBOmD/Fv9g==", "dev": true, "requires": { "@babel/highlight": "^7.18.6" @@ -7858,6 +8073,61 @@ "nullthrows": "^1.1.1", "posthtml": "^0.16.5", "svgo": "^2.4.0" + }, + "dependencies": { + "css-select": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/css-select/-/css-select-4.3.0.tgz", + "integrity": "sha512-wPpOYtnsVontu2mODhA19JrqWxNsfdatRKd64kmpRbQgh1KtItko5sTnEpPdpSaJszTOhEMlF/RPz28qj4HqhQ==", + "dev": true, + "requires": { + "boolbase": "^1.0.0", + "css-what": "^6.0.1", + "domhandler": "^4.3.1", + "domutils": "^2.8.0", + "nth-check": "^2.0.1" + } + }, + "css-tree": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/css-tree/-/css-tree-1.1.3.tgz", + "integrity": "sha512-tRpdppF7TRazZrjJ6v3stzv93qxRcSsFmW6cX0Zm2NVKpxE1WV1HblnghVv9TreireHkqI/VDEsfolRF1p6y7Q==", + "dev": true, + "requires": { + "mdn-data": "2.0.14", + "source-map": "^0.6.1" + } + }, + "csso": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/csso/-/csso-4.2.0.tgz", + "integrity": "sha512-wvlcdIbf6pwKEk7vHj8/Bkc0B4ylXZruLvOgs9doS5eOsOpuodOV2zJChSpkp+pRpYQLQMeF04nr3Z68Sta9jA==", + "dev": true, + "requires": { + "css-tree": "^1.1.2" + } + }, + "mdn-data": { + "version": "2.0.14", + "resolved": "https://registry.npmjs.org/mdn-data/-/mdn-data-2.0.14.tgz", + "integrity": "sha512-dn6wd0uw5GsdswPFfsgMp5NSB0/aDe6fK94YJV/AJDYXL6HVLWBsxeq7js7Ad+mU2K9LAlwpk6kN2D5mwCPVow==", + "dev": true + }, + "svgo": { + "version": "2.8.0", + "resolved": "https://registry.npmjs.org/svgo/-/svgo-2.8.0.tgz", + "integrity": "sha512-+N/Q9kV1+F+UeWYoSiULYo4xYSDQlTgb+ayMobAXPwMnLvop7oxKMo9OzIrX5x3eS4L4f2UHhc9axXwY8DpChg==", + "dev": true, + "requires": { + "@trysound/sax": "0.2.0", + "commander": "^7.2.0", + "css-select": "^4.1.3", + "css-tree": "^1.1.3", + "csso": "^4.2.0", + "picocolors": "^1.0.0", + "stable": "^0.1.8" + } + } } }, "@parcel/optimizer-image": { @@ -7883,6 +8153,61 @@ "@parcel/plugin": "2.8.1", "@parcel/utils": "2.8.1", "svgo": "^2.4.0" + }, + "dependencies": { + "css-select": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/css-select/-/css-select-4.3.0.tgz", + "integrity": "sha512-wPpOYtnsVontu2mODhA19JrqWxNsfdatRKd64kmpRbQgh1KtItko5sTnEpPdpSaJszTOhEMlF/RPz28qj4HqhQ==", + "dev": true, + "requires": { + "boolbase": "^1.0.0", + "css-what": "^6.0.1", + "domhandler": "^4.3.1", + "domutils": "^2.8.0", + "nth-check": "^2.0.1" + } + }, + "css-tree": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/css-tree/-/css-tree-1.1.3.tgz", + "integrity": "sha512-tRpdppF7TRazZrjJ6v3stzv93qxRcSsFmW6cX0Zm2NVKpxE1WV1HblnghVv9TreireHkqI/VDEsfolRF1p6y7Q==", + "dev": true, + "requires": { + "mdn-data": "2.0.14", + "source-map": "^0.6.1" + } + }, + "csso": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/csso/-/csso-4.2.0.tgz", + "integrity": "sha512-wvlcdIbf6pwKEk7vHj8/Bkc0B4ylXZruLvOgs9doS5eOsOpuodOV2zJChSpkp+pRpYQLQMeF04nr3Z68Sta9jA==", + "dev": true, + "requires": { + "css-tree": "^1.1.2" + } + }, + "mdn-data": { + "version": "2.0.14", + "resolved": "https://registry.npmjs.org/mdn-data/-/mdn-data-2.0.14.tgz", + "integrity": "sha512-dn6wd0uw5GsdswPFfsgMp5NSB0/aDe6fK94YJV/AJDYXL6HVLWBsxeq7js7Ad+mU2K9LAlwpk6kN2D5mwCPVow==", + "dev": true + }, + "svgo": { + "version": "2.8.0", + "resolved": "https://registry.npmjs.org/svgo/-/svgo-2.8.0.tgz", + "integrity": "sha512-+N/Q9kV1+F+UeWYoSiULYo4xYSDQlTgb+ayMobAXPwMnLvop7oxKMo9OzIrX5x3eS4L4f2UHhc9axXwY8DpChg==", + "dev": true, + "requires": { + "@trysound/sax": "0.2.0", + "commander": "^7.2.0", + "css-select": "^4.1.3", + "css-tree": "^1.1.3", + "csso": "^4.2.0", + "picocolors": "^1.0.0", + "stable": "^0.1.8" + } + } } }, "@parcel/optimizer-terser": { @@ -8440,12 +8765,6 @@ "integrity": "sha512-93+VvleD3mXwlLI/xASjw0FzKcwzl3OdTCzm1LaRfqgS21gfFtK3zDXM5Op9TeeMsJVOaJ2VRDpT9q4Y3d0AvA==", "dev": true }, - "@types/parse-json": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/@types/parse-json/-/parse-json-4.0.0.tgz", - "integrity": "sha512-//oorEZjL6sbPcKUaCdIGlIUeH26mgzimjBB77G6XRgnDl/L5wOnpyBGRe/Mmf5CVW3PwEBE1NjiMZ/ssFh4wA==", - "dev": true - }, "@types/shelljs": { "version": "0.8.11", "resolved": "https://registry.npmjs.org/@types/shelljs/-/shelljs-0.8.11.tgz", @@ -9035,6 +9354,12 @@ "delayed-stream": "~1.0.0" } }, + "commander": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/commander/-/commander-7.2.0.tgz", + "integrity": "sha512-QrWXB+ZQSVPmIWIhtEO9H+gwHaMGYiF5ChvoJ+K9ZGHG/sVsa6yiesAD1GC/x46sET00Xlwo1u49RVVVzvcSkw==", + "dev": true + }, "concat-map": { "version": "0.0.1", "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", @@ -9048,16 +9373,15 @@ "dev": true }, "cosmiconfig": { - "version": "7.1.0", - "resolved": "https://registry.npmjs.org/cosmiconfig/-/cosmiconfig-7.1.0.tgz", - "integrity": "sha512-AdmX6xUzdNASswsFtmwSt7Vj8po9IuqXm0UXz7QKPuEUmPB4XyjGfaAr2PSuELMwkRMVH1EpIkX5bTZGRB3eCA==", + "version": "8.1.3", + "resolved": "https://registry.npmjs.org/cosmiconfig/-/cosmiconfig-8.1.3.tgz", + "integrity": "sha512-/UkO2JKI18b5jVMJUp0lvKFMpa/Gye+ZgZjKD+DGEN9y7NRcf/nK1A0sp67ONmKtnDCNMS44E6jrk0Yc3bDuUw==", "dev": true, "requires": { - "@types/parse-json": "^4.0.0", "import-fresh": "^3.2.1", + "js-yaml": "^4.1.0", "parse-json": "^5.0.0", - "path-type": "^4.0.0", - "yaml": "^1.10.0" + "path-type": "^4.0.0" } }, "create-require": { @@ -9094,26 +9418,77 @@ } }, "css-select": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/css-select/-/css-select-4.3.0.tgz", - "integrity": "sha512-wPpOYtnsVontu2mODhA19JrqWxNsfdatRKd64kmpRbQgh1KtItko5sTnEpPdpSaJszTOhEMlF/RPz28qj4HqhQ==", + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/css-select/-/css-select-5.1.0.tgz", + "integrity": "sha512-nwoRF1rvRRnnCqqY7updORDsuqKzqYJ28+oSMaJMMgOauh3fvwHqMS7EZpIPqK8GL+g9mKxF1vP/ZjSeNjEVHg==", "dev": true, + "optional": true, + "peer": true, "requires": { "boolbase": "^1.0.0", - "css-what": "^6.0.1", - "domhandler": "^4.3.1", - "domutils": "^2.8.0", + "css-what": "^6.1.0", + "domhandler": "^5.0.2", + "domutils": "^3.0.1", "nth-check": "^2.0.1" + }, + "dependencies": { + "dom-serializer": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/dom-serializer/-/dom-serializer-2.0.0.tgz", + "integrity": "sha512-wIkAryiqt/nV5EQKqQpo3SToSOV9J0DnbJqwK7Wv/Trc92zIAYZ4FlMu+JPFW1DfGFt81ZTCGgDEabffXeLyJg==", + "dev": true, + "optional": true, + "peer": true, + "requires": { + "domelementtype": "^2.3.0", + "domhandler": "^5.0.2", + "entities": "^4.2.0" + } + }, + "domhandler": { + "version": "5.0.3", + "resolved": "https://registry.npmjs.org/domhandler/-/domhandler-5.0.3.tgz", + "integrity": "sha512-cgwlv/1iFQiFnU96XXgROh8xTeetsnJiDsTc7TYCLFd9+/WNkIqPTxiM/8pSd8VIrhXGTf1Ny1q1hquVqDJB5w==", + "dev": true, + "optional": true, + "peer": true, + "requires": { + "domelementtype": "^2.3.0" + } + }, + "domutils": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/domutils/-/domutils-3.0.1.tgz", + "integrity": "sha512-z08c1l761iKhDFtfXO04C7kTdPBLi41zwOZl00WS8b5eiaebNpY00HKbztwBq+e3vyqWNwWF3mP9YLUeqIrF+Q==", + "dev": true, + "optional": true, + "peer": true, + "requires": { + "dom-serializer": "^2.0.0", + "domelementtype": "^2.3.0", + "domhandler": "^5.0.1" + } + }, + "entities": { + "version": "4.5.0", + "resolved": "https://registry.npmjs.org/entities/-/entities-4.5.0.tgz", + "integrity": "sha512-V0hjH4dGPh9Ao5p0MoRY6BVqtwCjhz6vI5LT8AJ55H+4g9/4vbHx1I54fS0XuclLhDHArPQCiMjDxjaL8fPxhw==", + "dev": true, + "optional": true, + "peer": true + } } }, "css-tree": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/css-tree/-/css-tree-1.1.3.tgz", - "integrity": "sha512-tRpdppF7TRazZrjJ6v3stzv93qxRcSsFmW6cX0Zm2NVKpxE1WV1HblnghVv9TreireHkqI/VDEsfolRF1p6y7Q==", + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/css-tree/-/css-tree-2.3.1.tgz", + "integrity": "sha512-6Fv1DV/TYw//QF5IzQdqsNDjx/wc8TrMBZsqjL9eW01tWb7R7k/mq+/VXfJCl7SoD5emsJop9cOByJZfs8hYIw==", "dev": true, + "optional": true, + "peer": true, "requires": { - "mdn-data": "2.0.14", - "source-map": "^0.6.1" + "mdn-data": "2.0.30", + "source-map-js": "^1.0.1" } }, "css-what": { @@ -9129,12 +9504,36 @@ "dev": true }, "csso": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/csso/-/csso-4.2.0.tgz", - "integrity": "sha512-wvlcdIbf6pwKEk7vHj8/Bkc0B4ylXZruLvOgs9doS5eOsOpuodOV2zJChSpkp+pRpYQLQMeF04nr3Z68Sta9jA==", + "version": "5.0.5", + "resolved": "https://registry.npmjs.org/csso/-/csso-5.0.5.tgz", + "integrity": "sha512-0LrrStPOdJj+SPCCrGhzryycLjwcgUSHBtxNA8aIDxf0GLsRh1cKYhB00Gd1lDOS4yGH69+SNn13+TWbVHETFQ==", "dev": true, + "optional": true, + "peer": true, "requires": { - "css-tree": "^1.1.2" + "css-tree": "~2.2.0" + }, + "dependencies": { + "css-tree": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/css-tree/-/css-tree-2.2.1.tgz", + "integrity": "sha512-OA0mILzGc1kCOCSJerOeqDxDQ4HOh+G8NbOJFOTgOCzpw7fCBubk0fEyxp8AgOL/jvLgYA/uV0cMbe43ElF1JA==", + "dev": true, + "optional": true, + "peer": true, + "requires": { + "mdn-data": "2.0.28", + "source-map-js": "^1.0.1" + } + }, + "mdn-data": { + "version": "2.0.28", + "resolved": "https://registry.npmjs.org/mdn-data/-/mdn-data-2.0.28.tgz", + "integrity": "sha512-aylIc7Z9y4yzHYAJNuESG3hfhC+0Ibp/MAMiaOZgNv4pmEdFyfZhhhny4MNiAfWdBQ1RQ2mfDWmM1x8SvGyp8g==", + "dev": true, + "optional": true, + "peer": true + } } }, "cssom": { @@ -9977,12 +10376,12 @@ } }, "htmlnano": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/htmlnano/-/htmlnano-2.0.3.tgz", - "integrity": "sha512-S4PGGj9RbdgW8LhbILNK7W9JhmYP8zmDY7KDV/8eCiJBQJlbmltp5I0gv8c5ntLljfdxxfmJ+UJVSqyH4mb41A==", + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/htmlnano/-/htmlnano-2.0.4.tgz", + "integrity": "sha512-WGCkyGFwjKW1GeCBsPYacMvaMnZtFJ0zIRnC2NCddkA+IOEhTqskXrS7lep+3yYZw/nQ3dW1UAX4yA/GJyR8BA==", "dev": true, "requires": { - "cosmiconfig": "^7.0.1", + "cosmiconfig": "^8.0.0", "posthtml": "^0.16.5", "timsort": "^0.3.0" } @@ -10496,10 +10895,12 @@ } }, "mdn-data": { - "version": "2.0.14", - "resolved": "https://registry.npmjs.org/mdn-data/-/mdn-data-2.0.14.tgz", - "integrity": "sha512-dn6wd0uw5GsdswPFfsgMp5NSB0/aDe6fK94YJV/AJDYXL6HVLWBsxeq7js7Ad+mU2K9LAlwpk6kN2D5mwCPVow==", - "dev": true + "version": "2.0.30", + "resolved": "https://registry.npmjs.org/mdn-data/-/mdn-data-2.0.30.tgz", + "integrity": "sha512-GaqWWShW4kv/G9IEucWScBx9G1/vsFZZJUO+tD26M8J8z3Kw5RDQjaoZe03YAClgeS/SWPOcb4nkFBTEi5DUEA==", + "dev": true, + "optional": true, + "peer": true }, "merge-stream": { "version": "2.0.0", @@ -10873,14 +11274,6 @@ "commander": "^7.0.0", "get-port": "^4.2.0", "v8-compile-cache": "^2.0.0" - }, - "dependencies": { - "commander": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/commander/-/commander-7.2.0.tgz", - "integrity": "sha512-QrWXB+ZQSVPmIWIhtEO9H+gwHaMGYiF5ChvoJ+K9ZGHG/sVsa6yiesAD1GC/x46sET00Xlwo1u49RVVVzvcSkw==", - "dev": true - } } }, "parent-module": { @@ -10976,12 +11369,6 @@ "resolved": "https://registry.npmjs.org/commander/-/commander-9.5.0.tgz", "integrity": "sha512-KRs7WVDKg86PWiuAqhDrAQnTXZKraVcCc6vFdL14qrZ/DcWwuRo7VoiYXalXO7S5GKpqYiVEwCbgFDfxNHKJBQ==", "dev": true - }, - "yaml": { - "version": "2.2.1", - "resolved": "https://registry.npmjs.org/yaml/-/yaml-2.2.1.tgz", - "integrity": "sha512-e0WHiYql7+9wr4cWMx3TVQrNwejKaEe7/rHNmQmqRjazfOP5W8PB6Jpebb5o6fIapbz9o9+2ipcaTM2ZwDI6lw==", - "dev": true } } }, @@ -11518,26 +11905,19 @@ "dev": true }, "svgo": { - "version": "2.8.0", - "resolved": "https://registry.npmjs.org/svgo/-/svgo-2.8.0.tgz", - "integrity": "sha512-+N/Q9kV1+F+UeWYoSiULYo4xYSDQlTgb+ayMobAXPwMnLvop7oxKMo9OzIrX5x3eS4L4f2UHhc9axXwY8DpChg==", + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/svgo/-/svgo-3.0.2.tgz", + "integrity": "sha512-Z706C1U2pb1+JGP48fbazf3KxHrWOsLme6Rv7imFBn5EnuanDW1GPaA/P1/dvObE670JDePC3mnj0k0B7P0jjQ==", "dev": true, + "optional": true, + "peer": true, "requires": { "@trysound/sax": "0.2.0", "commander": "^7.2.0", - "css-select": "^4.1.3", - "css-tree": "^1.1.3", - "csso": "^4.2.0", - "picocolors": "^1.0.0", - "stable": "^0.1.8" - }, - "dependencies": { - "commander": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/commander/-/commander-7.2.0.tgz", - "integrity": "sha512-QrWXB+ZQSVPmIWIhtEO9H+gwHaMGYiF5ChvoJ+K9ZGHG/sVsa6yiesAD1GC/x46sET00Xlwo1u49RVVVzvcSkw==", - "dev": true - } + "css-select": "^5.1.0", + "css-tree": "^2.2.1", + "csso": "^5.0.5", + "picocolors": "^1.0.0" } }, "symbol-tree": { @@ -12056,9 +12436,9 @@ "dev": true }, "yaml": { - "version": "1.10.2", - "resolved": "https://registry.npmjs.org/yaml/-/yaml-1.10.2.tgz", - "integrity": "sha512-r3vXyErRCYJ7wg28yvBY5VSoAF8ZvlcW9/BwUzEtUsjvX/DKs24dIkuwjtuprwJJHsbyUbLApepYTR1BN4uHrg==", + "version": "2.2.2", + "resolved": "https://registry.npmjs.org/yaml/-/yaml-2.2.2.tgz", + "integrity": "sha512-CBKFWExMn46Foo4cldiChEzn7S7SRV+wqiluAb6xmueD/fGyRHIhX8m14vVGgeFWjN540nKCNVj6P21eQjgTuA==", "dev": true }, "yargs": { From 424abe722e5b2c3d72ce60a3b2cb7b67ddc475b6 Mon Sep 17 00:00:00 2001 From: Titouan Mathis Date: Wed, 26 Apr 2023 14:06:05 +0200 Subject: [PATCH 08/23] Fix CJS being injected in ESM files Fix #2735 --- webpack-plugin/src/loaders/include.ts | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/webpack-plugin/src/loaders/include.ts b/webpack-plugin/src/loaders/include.ts index f8705471..4bebcce9 100644 --- a/webpack-plugin/src/loaders/include.ts +++ b/webpack-plugin/src/loaders/include.ts @@ -30,8 +30,12 @@ export const pitch: PitchLoaderDefinitionFunction = function pit ...(globals ? Object.keys(globals).map((key) => `self[${JSON.stringify(key)}] = ${globals[key]};`) : []), - ...pre.map((include: any) => `require(${stringifyRequest(include)});`), - `module.exports = require(${stringifyRequest(`!!${remainingRequest}`)});`, - ...post.map((include: any) => `require(${stringifyRequest(include)});`) + ...pre.map((include: any) => `import ${stringifyRequest(include)};`), + ` +import * as monaco from ${stringifyRequest(`!!${remainingRequest}`)}; +export * from ${stringifyRequest(`!!${remainingRequest}`)}; +export default monaco; + `, + ...post.map((include: any) => `import ${stringifyRequest(include)};`) ].join('\n'); }; From 6b9d289ce3a7e2d162d822d294cf87c28da4c3c9 Mon Sep 17 00:00:00 2001 From: Henning Dieterichs Date: Thu, 27 Apr 2023 12:33:09 +0200 Subject: [PATCH 09/23] Retry failed compilation due to http 500 errors --- .azure-pipelines/publish-nightly.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.azure-pipelines/publish-nightly.yml b/.azure-pipelines/publish-nightly.yml index 4a757c36..0cc946c1 100644 --- a/.azure-pipelines/publish-nightly.yml +++ b/.azure-pipelines/publish-nightly.yml @@ -35,6 +35,7 @@ extends: displayName: Install NPM dependencies - script: yarn ts-node ./scripts/ci/monaco-editor-core-prepare nightly + retryCountOnTaskFailure: 5 displayName: Setup, Build & Test monaco-editor-core tag: next @@ -50,6 +51,7 @@ extends: displayName: Install NPM dependencies - script: yarn ts-node ./scripts/ci/monaco-editor-prepare nightly + retryCountOnTaskFailure: 5 displayName: Setup, Build & Test monaco-editor tag: next From 0e330ae453813de4e6cf272460fb79c7117073d0 Mon Sep 17 00:00:00 2001 From: Henning Dieterichs Date: Tue, 2 May 2023 14:17:58 +0200 Subject: [PATCH 10/23] 0.38.0 --- CHANGELOG.md | 14 ++++++++++++++ package.json | 4 ++-- 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index b4a60415..640fbc0e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,19 @@ # Monaco Editor Changelog +## [0.38.0] + +- `diffAlgorithm` values changed: `smart` -> `legacy`, `experimental` -> `advanced` +- New `registerEditorOpener` API +- New property `IViewZone.showInHiddenAreas` to show view zones in hidden areas +- New properties `InlineCompletions.suppressSuggestions` and `InlineCompletions.enableForwardStability` +- Bugfixes + +Contributions to `monaco-editor`: + +- [@dneto0 (David Neto)](https://github.com/dneto0): Add WebGPU Shading Language tokenizer, with tests [PR #3884](https://github.com/microsoft/monaco-editor/pull/3884) +- [@kisstkondoros (Tamas Kiss)](https://github.com/kisstkondoros): Fix reference error in convert method of OutlineAdapter [PR #3924](https://github.com/microsoft/monaco-editor/pull/3924) +- [@tamayika](https://github.com/tamayika): Change moduleResolution to node16 and adopt TS 5.0 [PR #3860](https://github.com/microsoft/monaco-editor/pull/3860) + ## [0.37.1] - Fixes Inline Completions feature diff --git a/package.json b/package.json index 68fb1602..cf79ff20 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "monaco-editor", - "version": "0.37.1", - "vscodeRef": "8f74fbfd1f2d8f6268a42df131726b218aafe511", + "version": "0.38.0", + "vscodeRef": "5474fca23cc6723a6f72975fbf00672c331fed2c", "private": true, "description": "A browser based code editor", "homepage": "https://github.com/microsoft/monaco-editor", From 311eaa4dfbdff508c54bda5eddb9a1c940c1bd43 Mon Sep 17 00:00:00 2001 From: Brett Morgan Date: Thu, 4 May 2023 06:38:50 +1000 Subject: [PATCH 11/23] Update `monaco.d.ts` link fixes: https://github.com/microsoft/monaco-editor/issues/3941 Linked to node hosted `monaco.d.ts` file as the docs are already linked on the same line. --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 297e8cf9..dfdb2b82 100644 --- a/README.md +++ b/README.md @@ -37,7 +37,7 @@ It is recommended to develop against the `dev` version, and in production to use - [Integrate the AMD version](./docs/integrate-amd.md). - [Integrate the ESM version](./docs/integrate-esm.md) - Learn how to use the editor API and try out your own customizations in the [playground](https://microsoft.github.io/monaco-editor/playground.html). -- Explore the [API docs](https://microsoft.github.io/monaco-editor/docs.html) or read them straight from [`monaco.d.ts`](https://github.com/microsoft/monaco-editor/blob/main/website/typedoc/monaco.d.ts). +- Explore the [API docs](https://microsoft.github.io/monaco-editor/docs.html) or read them straight from [`monaco.d.ts`](https://microsoft.github.io/monaco-editor/node_modules/monaco-editor/monaco.d.ts). - Read [this guide](https://github.com/microsoft/monaco-editor/wiki/Accessibility-Guide-for-Integrators) to ensure the editor is accessible to all your users! - Create a Monarch tokenizer for a new programming language [in the Monarch playground](https://microsoft.github.io/monaco-editor/monarch.html). - Ask questions on [StackOverflow](https://stackoverflow.com/questions/tagged/monaco-editor)! Search open and closed issues, there are a lot of tips in there! From f62e7242540d8a85ce88b77339220b387c168d93 Mon Sep 17 00:00:00 2001 From: Dmitry Litsman Date: Sat, 6 May 2023 10:30:03 +0100 Subject: [PATCH 12/23] Extend the example to include a transparent color note. --- .../rendering-glyphs-in-the-margin/sample.css | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/website/src/website/data/playground-samples/interacting-with-the-editor/rendering-glyphs-in-the-margin/sample.css b/website/src/website/data/playground-samples/interacting-with-the-editor/rendering-glyphs-in-the-margin/sample.css index 6aa88f43..92c07cbc 100644 --- a/website/src/website/data/playground-samples/interacting-with-the-editor/rendering-glyphs-in-the-margin/sample.css +++ b/website/src/website/data/playground-samples/interacting-with-the-editor/rendering-glyphs-in-the-margin/sample.css @@ -2,5 +2,6 @@ background: red; } .myContentClass { - background: lightblue; + /* Make sure to use transparent colors for the selection to work */ + background: rgba(173, 216, 230, 0.5); } From 0c6348a71d02351ad7d5c3ac2660cb19902c919d Mon Sep 17 00:00:00 2001 From: Henning Dieterichs Date: Fri, 26 May 2023 18:24:54 +0200 Subject: [PATCH 13/23] Makes editor on main page writeable. (#3976) --- website/src/website/components/monaco/MonacoEditor.tsx | 1 + website/src/website/pages/home/Home.tsx | 1 + 2 files changed, 2 insertions(+) diff --git a/website/src/website/components/monaco/MonacoEditor.tsx b/website/src/website/components/monaco/MonacoEditor.tsx index bd8d47af..57e47761 100644 --- a/website/src/website/components/monaco/MonacoEditor.tsx +++ b/website/src/website/components/monaco/MonacoEditor.tsx @@ -249,6 +249,7 @@ export class MonacoDiffEditor extends React.Component< minimap: { enabled: false }, automaticLayout: false, theme: this.props.theme, + originalEditable: true, }); this.editor.setModel({ original: this.props.originalModel, diff --git a/website/src/website/pages/home/Home.tsx b/website/src/website/pages/home/Home.tsx index 9e77ebf3..1f3bde98 100644 --- a/website/src/website/pages/home/Home.tsx +++ b/website/src/website/pages/home/Home.tsx @@ -217,6 +217,7 @@ class EditorDemo extends React.Component { value={this.currentSample.value || "loading..."} language={this.currentLanguage?.id} theme={this.currentTheme.id} + onDidValueChange={() => {}} /> From 292c2400a0fbc5db7d6cf099da027cf26d5731b7 Mon Sep 17 00:00:00 2001 From: Henning Dieterichs Date: Wed, 31 May 2023 17:19:52 +0200 Subject: [PATCH 14/23] Fixes slow regexp issue --- website/src/website/pages/playground/PlaygroundModel.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/website/src/website/pages/playground/PlaygroundModel.ts b/website/src/website/pages/playground/PlaygroundModel.ts index 51dd801c..58668cab 100644 --- a/website/src/website/pages/playground/PlaygroundModel.ts +++ b/website/src/website/pages/playground/PlaygroundModel.ts @@ -247,7 +247,7 @@ export class PlaygroundModel { const regexp = new RegExp( "(\\b" + escapeRegexpChars(codeStringName) + - ":[^\\w`]*`)([^`\\\\]|\\n|\\\\\\\\|\\\\`)*`" + ":[^\\w`]*`)([^`\\\\\\n]|\\n|\\\\\\\\|\\\\|\\$`)*`" ); const js = this.js; const str = value From 5744a230ae4299afc1b3e4c28a53005391e7dce2 Mon Sep 17 00:00:00 2001 From: Henning Dieterichs Date: Fri, 2 Jun 2023 00:52:09 +0200 Subject: [PATCH 15/23] Fixes regexp --- website/src/website/pages/playground/PlaygroundModel.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/website/src/website/pages/playground/PlaygroundModel.ts b/website/src/website/pages/playground/PlaygroundModel.ts index 58668cab..3133d9ba 100644 --- a/website/src/website/pages/playground/PlaygroundModel.ts +++ b/website/src/website/pages/playground/PlaygroundModel.ts @@ -247,12 +247,12 @@ export class PlaygroundModel { const regexp = new RegExp( "(\\b" + escapeRegexpChars(codeStringName) + - ":[^\\w`]*`)([^`\\\\\\n]|\\n|\\\\\\\\|\\\\|\\$`)*`" + ":[^\\w`]*`)([^`\\\\\\n]|\\n|\\\\\\\\|\\\\\\`|\\\\\\$)*`" ); const js = this.js; const str = value .replaceAll("\\", "\\\\") - .replaceAll("$", "\\$") + .replaceAll("$", "\\$$$$") .replaceAll("`", "\\`"); const newJs = js.replace(regexp, "$1" + str + "`"); const autoReload = this.settings.autoReload; From 74470a5fb2c2e7672489ca2bdd37aadd7d531877 Mon Sep 17 00:00:00 2001 From: Henning Dieterichs Date: Mon, 5 Jun 2023 17:40:14 +0200 Subject: [PATCH 16/23] Allows for manual nightly builds. --- .azure-pipelines/publish-nightly.yml | 16 ++++++++++++++++ scripts/ci/env.ts | 6 ++++++ scripts/ci/monaco-editor-core-prepare.ts | 5 +++-- scripts/ci/monaco-editor-prepare.ts | 3 ++- scripts/lib/index.ts | 6 ++++-- 5 files changed, 31 insertions(+), 5 deletions(-) create mode 100644 scripts/ci/env.ts diff --git a/.azure-pipelines/publish-nightly.yml b/.azure-pipelines/publish-nightly.yml index 0cc946c1..e6efeeed 100644 --- a/.azure-pipelines/publish-nightly.yml +++ b/.azure-pipelines/publish-nightly.yml @@ -23,6 +23,16 @@ resources: ref: main endpoint: Monaco +parameters: + - name: vscodeRef + displayName: The VS Code commit id. When left empty, the main branched is used. + type: string + default: '' + - name: prereleaseVersion + displayName: The prerelease version. When left empty, dev-${today} is used. + type: string + default: '' + extends: template: azure-pipelines/npm-package/pipeline.yml@templates parameters: @@ -35,6 +45,9 @@ extends: displayName: Install NPM dependencies - script: yarn ts-node ./scripts/ci/monaco-editor-core-prepare nightly + env: + VSCODE_REF: ${{ parameters.vscodeRef }} + PRERELEASE_VERSION: ${{ parameters.prereleaseVersion }} retryCountOnTaskFailure: 5 displayName: Setup, Build & Test monaco-editor-core @@ -51,6 +64,9 @@ extends: displayName: Install NPM dependencies - script: yarn ts-node ./scripts/ci/monaco-editor-prepare nightly + env: + VSCODE_REF: ${{ parameters.vscodeRef }} + PRERELEASE_VERSION: ${{ parameters.prereleaseVersion }} retryCountOnTaskFailure: 5 displayName: Setup, Build & Test monaco-editor diff --git a/scripts/ci/env.ts b/scripts/ci/env.ts new file mode 100644 index 00000000..222743fa --- /dev/null +++ b/scripts/ci/env.ts @@ -0,0 +1,6 @@ +export function getEnv(): { + VSCODE_REF: string | undefined; + PRERELEASE_VERSION: string | undefined; +} { + return process.env as any; +} diff --git a/scripts/ci/monaco-editor-core-prepare.ts b/scripts/ci/monaco-editor-core-prepare.ts index ea70c44b..1cae7348 100644 --- a/scripts/ci/monaco-editor-core-prepare.ts +++ b/scripts/ci/monaco-editor-core-prepare.ts @@ -1,6 +1,7 @@ import { mkdir, rm } from 'fs/promises'; import { join, resolve } from 'path'; import { PackageJson, group, gitShallowClone, run, writeJsonFile, getNightlyVersion } from '../lib'; +import { getEnv } from './env'; const selfPath = __dirname; const rootPath = join(selfPath, '..', '..'); @@ -21,8 +22,8 @@ async function prepareMonacoEditorCoreReleaseStableOrNightly() { version = monacoEditorPackageJson.version; ref = monacoEditorPackageJson.vscodeRef; } else if (arg === 'nightly') { - version = getNightlyVersion(monacoEditorPackageJson.version); - ref = 'main'; + version = getNightlyVersion(monacoEditorPackageJson.version, getEnv().PRERELEASE_VERSION); + ref = getEnv().VSCODE_REF || 'main'; } else { throw new Error('Invalid argument'); } diff --git a/scripts/ci/monaco-editor-prepare.ts b/scripts/ci/monaco-editor-prepare.ts index 2791ec84..f7f81f13 100644 --- a/scripts/ci/monaco-editor-prepare.ts +++ b/scripts/ci/monaco-editor-prepare.ts @@ -1,6 +1,7 @@ import { readFile } from 'fs/promises'; import { join, resolve } from 'path'; import { PackageJson, getNightlyVersion, group, run, writeJsonFile, gitCommitId } from '../lib'; +import { getEnv } from './env'; const selfPath = __dirname; const rootPath = join(selfPath, '..', '..'); @@ -23,7 +24,7 @@ async function prepareMonacoEditorReleaseStableOrNightly() { if (arg === 'stable') { version = monacoEditorPackageJson.version; } else if (arg === 'nightly') { - version = getNightlyVersion(monacoEditorPackageJson.version); + version = getNightlyVersion(monacoEditorPackageJson.version, getEnv().PRERELEASE_VERSION); } else { throw new Error('Invalid argument'); } diff --git a/scripts/lib/index.ts b/scripts/lib/index.ts index 4db4cfe2..a8eca48d 100644 --- a/scripts/lib/index.ts +++ b/scripts/lib/index.ts @@ -73,14 +73,16 @@ export async function writeJsonFile(filePath: string, jsonData: unknown): Promis await writeFile(filePath, JSON.stringify(jsonData, null, '\t') + '\n'); } -export function getNightlyVersion(version: string): string { +export function getNightlyVersion(version: string, prerelease: string | undefined): string { const pieces = version.split('.'); const minor = parseInt(pieces[1], 10); const date = new Date(); const yyyy = date.getUTCFullYear(); const mm = String(date.getUTCMonth() + 1).padStart(2, '0'); const dd = String(date.getUTCDate()).padStart(2, '0'); - return `0.${minor + 1}.0-dev.${yyyy}${mm}${dd}`; + + prerelease = prerelease || `dev.${yyyy}${mm}${dd}`; + return `0.${minor + 1}.0-${prerelease}`; } export interface PackageJson { From 6c7d6b1e2f374599d04950eb83515f2b113c3b24 Mon Sep 17 00:00:00 2001 From: Henning Dieterichs Date: Tue, 6 Jun 2023 00:07:17 +0200 Subject: [PATCH 17/23] 0.39.0 --- CHANGELOG.md | 14 ++++++++++++++ package.json | 6 +++--- 2 files changed, 17 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 640fbc0e..36b2eb14 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,19 @@ # Monaco Editor Changelog +## [0.39.0] + +- New method `Environment.createTrustedTypesPolicy` to override trusted types handling. +- Bugfixes + +Contributions to `monaco-editor`: + +- [@dlitsman (Dmitry Litsman)](https://github.com/dlitsman): Extend the "Rendering Glyphs In The Margin" example to include a transparent color note. [PR #3945](https://github.com/microsoft/monaco-editor/pull/3945) +- [@dneto0 (David Neto)](https://github.com/dneto0): Avoid a hack in the WGSL lexer [PR #3887](https://github.com/microsoft/monaco-editor/pull/3887) +- [@spahnke (Sebastian Pahnke)](https://github.com/spahnke) + - [JS, TS] Add Monarch support for private identifiers [PR #3919](https://github.com/microsoft/monaco-editor/pull/3919) + - [JS] Add static keyword [PR #3922](https://github.com/microsoft/monaco-editor/pull/3922) +- [@titouanmathis (Titouan Mathis)](https://github.com/titouanmathis): [Webpack Plugin] Fix CJS being injected in ESM files [PR #3933](https://github.com/microsoft/monaco-editor/pull/3933) + ## [0.38.0] - `diffAlgorithm` values changed: `smart` -> `legacy`, `experimental` -> `advanced` diff --git a/package.json b/package.json index cf79ff20..5827fd07 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "monaco-editor", - "version": "0.38.0", - "vscodeRef": "5474fca23cc6723a6f72975fbf00672c331fed2c", + "version": "0.39.0", + "vscodeRef": "78390793536f5f43e17ff7c97b260bd2a5d1060c", "private": true, "description": "A browser based code editor", "homepage": "https://github.com/microsoft/monaco-editor", @@ -52,7 +52,7 @@ "jsdom": "^19.0.0", "jsonc-parser": "^3.0.0", "mocha": "^9.2.0", - "monaco-editor-core": "^0.37.0-dev.20230403", + "monaco-editor-core": "^0.39.0-dev.20230605", "parcel": "^2.7.0", "pin-github-action": "^1.8.0", "playwright": "^1.32.2", From 815929cfc174fffef327f7d1d57c6358e1cc8225 Mon Sep 17 00:00:00 2001 From: Henning Dieterichs Date: Tue, 6 Jun 2023 10:26:20 +0200 Subject: [PATCH 18/23] Update lock file --- package-lock.json | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/package-lock.json b/package-lock.json index 0089fa02..79322489 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "monaco-editor", - "version": "0.37.1", + "version": "0.39.0", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "monaco-editor", - "version": "0.37.1", + "version": "0.39.0", "hasInstallScript": true, "license": "MIT", "devDependencies": { @@ -25,7 +25,7 @@ "jsdom": "^19.0.0", "jsonc-parser": "^3.0.0", "mocha": "^9.2.0", - "monaco-editor-core": "^0.37.0-dev.20230403", + "monaco-editor-core": "^0.39.0-dev.20230605", "parcel": "^2.7.0", "pin-github-action": "^1.8.0", "playwright": "^1.32.2", @@ -5326,9 +5326,9 @@ "dev": true }, "node_modules/monaco-editor-core": { - "version": "0.37.0-dev.20230403", - "resolved": "https://registry.npmjs.org/monaco-editor-core/-/monaco-editor-core-0.37.0-dev.20230403.tgz", - "integrity": "sha512-p77v5G3WNBSSCLY8ORkNkP5XmAOQj7QwxkyzyILj+sWFbw3/1B9SIead0QS368FHV7JKCZ8/LR5T5ccBUZJlJg==", + "version": "0.39.0-rc2", + "resolved": "https://registry.npmjs.org/monaco-editor-core/-/monaco-editor-core-0.39.0-rc2.tgz", + "integrity": "sha512-PVOMjeVt17EvLIa27CmtVIqUz500mHPmsMJpKbVjV1fHCaRHoK38Qrk+lYWXM4MAHFOeUb1GNlj8Z1TnqlOJSw==", "dev": true }, "node_modules/mri": { @@ -11020,9 +11020,9 @@ } }, "monaco-editor-core": { - "version": "0.37.0-dev.20230403", - "resolved": "https://registry.npmjs.org/monaco-editor-core/-/monaco-editor-core-0.37.0-dev.20230403.tgz", - "integrity": "sha512-p77v5G3WNBSSCLY8ORkNkP5XmAOQj7QwxkyzyILj+sWFbw3/1B9SIead0QS368FHV7JKCZ8/LR5T5ccBUZJlJg==", + "version": "0.39.0-rc2", + "resolved": "https://registry.npmjs.org/monaco-editor-core/-/monaco-editor-core-0.39.0-rc2.tgz", + "integrity": "sha512-PVOMjeVt17EvLIa27CmtVIqUz500mHPmsMJpKbVjV1fHCaRHoK38Qrk+lYWXM4MAHFOeUb1GNlj8Z1TnqlOJSw==", "dev": true }, "mri": { From 35ba0194b2292d434e43de57e5804971a821ca0d Mon Sep 17 00:00:00 2001 From: Henning Dieterichs Date: Tue, 6 Jun 2023 10:30:14 +0200 Subject: [PATCH 19/23] Include package.json content in cache key --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index cfb85827..c315421d 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -18,7 +18,7 @@ jobs: uses: actions/cache@v2 with: path: '**/node_modules' - key: ${{ runner.os }}-cacheNodeModules2-${{ hashFiles('**/package-lock.json') }} + key: ${{ runner.os }}-cacheNodeModules2-${{ hashFiles('**/package-lock.json', '**/package.json') }} restore-keys: ${{ runner.os }}-cacheNodeModules2- - name: execute `npm ci` (1) From 6b79219c16cd4750243bda84f04f10955d439754 Mon Sep 17 00:00:00 2001 From: Henning Dieterichs Date: Tue, 6 Jun 2023 14:52:06 +0200 Subject: [PATCH 20/23] Update publishing steps --- MAINTAINING.md | 42 +++++++++++++++++++++++------------------- 1 file changed, 23 insertions(+), 19 deletions(-) diff --git a/MAINTAINING.md b/MAINTAINING.md index 9b71b787..95fbfe19 100644 --- a/MAINTAINING.md +++ b/MAINTAINING.md @@ -2,29 +2,26 @@ (For maintainers only) -- [P1 Inbox Queue](https://github.com/microsoft/monaco-editor/issues?q=is%3Aissue+is%3Aopen+-label%3Afeature-request+-label%3Aquestion+-label%3Aupstream+-label%3A%22help+wanted%22+-label%3A%22info-needed%22+-label%3A%22as-designed%22+-label%3Abug+-label%3A*question+) -- [Inbox Queue](https://github.com/microsoft/monaco-editor/issues?q=is%3Aissue+is%3Aopen+no%3Aassignee+-label%3Afeature-request+-label%3Aquestion+-label%3Aupstream+-label%3A%22help+wanted%22+-label%3A%22info-needed%22+-label%3A%22as-designed%22+) +Make sure every unassigned issue is labeled properly: -## Updating TypeScript +- [Inbox Queue](https://github.com/microsoft/monaco-editor/issues?q=is%3Aissue+is%3Aopen+no%3Aassignee+-label%3Afeature-request+-label%3Aupstream+-label%3A%22info-needed%22++-label%3Abug+) -- change typescript's version in `package.json`. -- execute `npm install .` -- execute `npm run import-typescript` -- adopt new APIs +## Publishing a stable build monaco-editor build -## Shipping a new monaco-editor npm module +- Make sure there exists a nightly build from the VS Code commit the stable build should be built from +- [Compare Last Stable With Nightly](https://microsoft.github.io/monaco-editor/playground.html?source=v0.39.0-dev.20230606#XQAAAAKzBQAAAAAAAABBqQkHQ5NjdMjwa-jY7SIQ9S7DNlzs5W-mwj0fe1ZCDRFc9ws9XQE0SJE1jc2VKxhaLFIw9vEWSxW3yscw9ajfg2SGxNmVfIdymzfNMmpU96miXJZvs8c7gcyo98bKVzbks7HoMVAZiOQjzsGSo4vYRPplxTKh4qJ5_s9m1RB0u1a8RPwJXtmqrYtToAekuwuDQ2im8_QvtfSt1HbJIiHVd2zPiTBSeoC03JVOCBfBsHUM0AOblitxr0yoEKp5yCNj9Xx68iP2xX6l7R-oQQP0QegyE5JU_S6OAtnV--nu4J_lwqYHYrlBXuqsqRU-cKhSqrbrcWCxKMEmQyZkUHmM75vxSD8qepWmGk7BA4eU4YQI7tZ6g74Y0LXfIckS_2A-xIQYChatES1wLXoLosL4FhDqugt7bJg6Lelf09SdwM_NgJuVqmU8jOyMkHaKZ4nkZt61mFhR3Wa4KUfFUTCro6cKL3tIHInvgOfg8gpWdNOKy19pICfKSDYlWkn6rPgZxR0b-KCbY8K3_B6h8_TU8JfXlva5OmzfgvNBQcN_UE95r5zuBUua8JDaVLTOUKDRsOj5DYNx9KGGgicA2qjH3IlyyuOfgPTmNssWQv496rVgpqm4Zpt3DGSDY-1vxbGQe7m135DxLbACD70fgH8-C-ou2umXUKDrJbZJI2EFFMvzvZVBZVEp7Fa2j7161WJ_oyFj1HvHtTMvvrE_0P2g-u--1zh_9OHJ_ybwLAA) + - Update [package.json](./package.json) + - set `version` to next stable + - set `vscodeRef` to _vscodeCommitId_ + - update `devDependencies.monaco-editor-core` to _version_ + - Run `npm install` to update lockfile + - Update [CHANGELOG.md](./CHANGELOG.md) + - API Changes / Breaking Changes / New and noteworthy + - Thank you ([use this tool](https://vscode-tools.azurewebsites.net/acknowledgement/)) + - Commit + - [Trigger build](https://dev.azure.com/monacotools/Monaco/_build?definitionId=416) -- update `package.json` and bump `"version"` as necessary -- update `package.json` and edit `"vscode"` to point to the vscode repo commit that should be shipped at `monaco-editor-core` (both `monaco-editor-core` and `monaco-editor` will be published under the same version defined in `package.json`). -- write entry in `CHANGELOG.md` - - API Changes / Breaking Changes / New and noteworthy - - Thank you ([use this tool](https://vscode-tools.azurewebsites.net/acknowledgement/)) -- trigger a build using [`Publish to npm`](https://github.com/microsoft/monaco-editor/actions/workflows/publish.yml) and type false when asked "is nightly?" -- if the publish succeeded, run `git tag 0.x.y` and `git push origin 0.x.y` -- edit `package.json` and update the `"monaco-editor-core"` dev dependency. -- run `npm install` - -#### 8. Publish new webpack plugin +#### Publish new webpack plugin - **TBD** - https://github.com/microsoft/monaco-editor/tree/main/webpack-plugin @@ -41,3 +38,10 @@ - use `npm version major` - publish using `npm publish` - remember to push tags upstream + +## Updating TypeScript + +- change typescript's version in `package.json`. +- execute `npm install .` +- execute `npm run import-typescript` +- adopt new APIs From 12a85be518baa63571b5ccf780cfeec12b0ff2b4 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 6 Jun 2023 06:25:16 -0700 Subject: [PATCH 21/23] Bump vite from 3.2.5 to 3.2.7 (#4005) Bumps [vite](https://github.com/vitejs/vite/tree/HEAD/packages/vite) from 3.2.5 to 3.2.7. - [Release notes](https://github.com/vitejs/vite/releases) - [Changelog](https://github.com/vitejs/vite/blob/v3.2.7/packages/vite/CHANGELOG.md) - [Commits](https://github.com/vitejs/vite/commits/v3.2.7/packages/vite) --- updated-dependencies: - dependency-name: vite dependency-type: direct:development ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- package-lock.json | 14 +++++++------- package.json | 2 +- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/package-lock.json b/package-lock.json index 79322489..fd3f32bc 100644 --- a/package-lock.json +++ b/package-lock.json @@ -37,7 +37,7 @@ "terser": "^5.14.2", "ts-node": "^10.6.0", "typescript": "^5.0.2", - "vite": "^3.1.8", + "vite": "^3.2.7", "vscode-css-languageservice": "5.4.1", "vscode-html-languageservice": "4.2.4", "vscode-json-languageservice": "4.2.1", @@ -6928,9 +6928,9 @@ "dev": true }, "node_modules/vite": { - "version": "3.2.5", - "resolved": "https://registry.npmjs.org/vite/-/vite-3.2.5.tgz", - "integrity": "sha512-4mVEpXpSOgrssFZAOmGIr85wPHKvaDAcXqxVxVRZhljkJOMZi1ibLibzjLHzJvcok8BMguLc7g1W6W/GqZbLdQ==", + "version": "3.2.7", + "resolved": "https://registry.npmjs.org/vite/-/vite-3.2.7.tgz", + "integrity": "sha512-29pdXjk49xAP0QBr0xXqu2s5jiQIXNvE/xwd0vUizYT2Hzqe4BksNNoWllFVXJf4eLZ+UlVQmXfB4lWrc+t18g==", "dev": true, "dependencies": { "esbuild": "^0.15.9", @@ -12145,9 +12145,9 @@ "dev": true }, "vite": { - "version": "3.2.5", - "resolved": "https://registry.npmjs.org/vite/-/vite-3.2.5.tgz", - "integrity": "sha512-4mVEpXpSOgrssFZAOmGIr85wPHKvaDAcXqxVxVRZhljkJOMZi1ibLibzjLHzJvcok8BMguLc7g1W6W/GqZbLdQ==", + "version": "3.2.7", + "resolved": "https://registry.npmjs.org/vite/-/vite-3.2.7.tgz", + "integrity": "sha512-29pdXjk49xAP0QBr0xXqu2s5jiQIXNvE/xwd0vUizYT2Hzqe4BksNNoWllFVXJf4eLZ+UlVQmXfB4lWrc+t18g==", "dev": true, "requires": { "esbuild": "^0.15.9", diff --git a/package.json b/package.json index 5827fd07..f99c75e2 100644 --- a/package.json +++ b/package.json @@ -64,7 +64,7 @@ "terser": "^5.14.2", "ts-node": "^10.6.0", "typescript": "^5.0.2", - "vite": "^3.1.8", + "vite": "^3.2.7", "vscode-css-languageservice": "5.4.1", "vscode-html-languageservice": "4.2.4", "vscode-json-languageservice": "4.2.1", From 0d7608bd10bbbe5e997bf4ed11e0ba4571e5e2b1 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 6 Jun 2023 13:26:12 +0000 Subject: [PATCH 22/23] Bump vite from 2.9.13 to 2.9.16 in /samples/browser-esm-vite-react Bumps [vite](https://github.com/vitejs/vite/tree/HEAD/packages/vite) from 2.9.13 to 2.9.16. - [Release notes](https://github.com/vitejs/vite/releases) - [Changelog](https://github.com/vitejs/vite/blob/v2.9.16/packages/vite/CHANGELOG.md) - [Commits](https://github.com/vitejs/vite/commits/v2.9.16/packages/vite) --- updated-dependencies: - dependency-name: vite dependency-type: direct:development ... Signed-off-by: dependabot[bot] --- .../browser-esm-vite-react/package-lock.json | 18 +++++++++--------- samples/browser-esm-vite-react/package.json | 2 +- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/samples/browser-esm-vite-react/package-lock.json b/samples/browser-esm-vite-react/package-lock.json index 66a08f5f..22e369d4 100644 --- a/samples/browser-esm-vite-react/package-lock.json +++ b/samples/browser-esm-vite-react/package-lock.json @@ -13,7 +13,7 @@ "react": "^17.0.2", "react-dom": "^17.0.2", "typescript": "^5.0.2", - "vite": "^2.9.13" + "vite": "^2.9.16" } }, "node_modules/@ampproject/remapping": { @@ -1372,15 +1372,15 @@ } }, "node_modules/vite": { - "version": "2.9.13", - "resolved": "https://registry.npmjs.org/vite/-/vite-2.9.13.tgz", - "integrity": "sha512-AsOBAaT0AD7Mhe8DuK+/kE4aWYFMx/i0ZNi98hJclxb4e0OhQcZYUrvLjIaQ8e59Ui7txcvKMiJC1yftqpQoDw==", + "version": "2.9.16", + "resolved": "https://registry.npmjs.org/vite/-/vite-2.9.16.tgz", + "integrity": "sha512-X+6q8KPyeuBvTQV8AVSnKDvXoBMnTx8zxh54sOwmmuOdxkjMmEJXH2UEchA+vTMps1xw9vL64uwJOWryULg7nA==", "dev": true, "dependencies": { "esbuild": "^0.14.27", "postcss": "^8.4.13", "resolve": "^1.22.0", - "rollup": "^2.59.0" + "rollup": ">=2.59.0 <2.78.0" }, "bin": { "vite": "bin/vite.js" @@ -2298,16 +2298,16 @@ "dev": true }, "vite": { - "version": "2.9.13", - "resolved": "https://registry.npmjs.org/vite/-/vite-2.9.13.tgz", - "integrity": "sha512-AsOBAaT0AD7Mhe8DuK+/kE4aWYFMx/i0ZNi98hJclxb4e0OhQcZYUrvLjIaQ8e59Ui7txcvKMiJC1yftqpQoDw==", + "version": "2.9.16", + "resolved": "https://registry.npmjs.org/vite/-/vite-2.9.16.tgz", + "integrity": "sha512-X+6q8KPyeuBvTQV8AVSnKDvXoBMnTx8zxh54sOwmmuOdxkjMmEJXH2UEchA+vTMps1xw9vL64uwJOWryULg7nA==", "dev": true, "requires": { "esbuild": "^0.14.27", "fsevents": "~2.3.2", "postcss": "^8.4.13", "resolve": "^1.22.0", - "rollup": "^2.59.0" + "rollup": ">=2.59.0 <2.78.0" } } } diff --git a/samples/browser-esm-vite-react/package.json b/samples/browser-esm-vite-react/package.json index a760b02a..07ff5a1b 100644 --- a/samples/browser-esm-vite-react/package.json +++ b/samples/browser-esm-vite-react/package.json @@ -15,6 +15,6 @@ "@types/react-dom": "^17.0.11", "@vitejs/plugin-react": "^1.1.4", "typescript": "^5.0.2", - "vite": "^2.9.13" + "vite": "^2.9.16" } } From 990456e51f6b6d201f25326316e2894deb64ca4d Mon Sep 17 00:00:00 2001 From: Henning Dieterichs Date: Mon, 12 Jun 2023 11:49:15 +0200 Subject: [PATCH 23/23] Repairs example urls --- .vscode/launch.json | 6 ++++ .../pages/playground/PlaygroundModel.ts | 33 ++++++++++++------- 2 files changed, 28 insertions(+), 11 deletions(-) diff --git a/.vscode/launch.json b/.vscode/launch.json index 2d19c833..44c09c98 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -15,6 +15,12 @@ "order": 1 } }, + { + "name": "Website", + "type": "chrome", + "request": "launch", + "url": "http://localhost:8080/" + }, { // Clone VS Code and make sure the task "Launch Http Server" runs. // Then the editor is build from sources. diff --git a/website/src/website/pages/playground/PlaygroundModel.ts b/website/src/website/pages/playground/PlaygroundModel.ts index 3133d9ba..c21bfa31 100644 --- a/website/src/website/pages/playground/PlaygroundModel.ts +++ b/website/src/website/pages/playground/PlaygroundModel.ts @@ -322,12 +322,18 @@ function projectEquals( project2: IPlaygroundProject ): boolean { return ( - project1.css === project2.css && - project1.html === project2.html && - project1.js === project2.js + normalizeLineEnding(project1.css) === + normalizeLineEnding(project2.css) && + normalizeLineEnding(project1.html) === + normalizeLineEnding(project2.html) && + normalizeLineEnding(project1.js) === normalizeLineEnding(project2.js) ); } +function normalizeLineEnding(str: string): string { + return str.replace(/\r\n/g, "\n"); +} + class StateUrlSerializer implements IHistoryModel { public readonly dispose = Disposable.fn(); @@ -443,16 +449,21 @@ class StateUrlSerializer implements IHistoryModel { this._sourceOverride = source; } + function findExample(hashValue: string): PlaygroundExample | undefined { + if (hashValue.startsWith("example-")) { + hashValue = hashValue.substring("example-".length); + } + return getPlaygroundExamples() + .flatMap((e) => e.examples) + .find((e) => e.id === hashValue); + } + + let example: PlaygroundExample | undefined; + if (!hashValue) { this.model.selectedExample = getPlaygroundExamples()[0].examples[0]; - } else if (hashValue.startsWith("example-")) { - const exampleName = hashValue.substring("example-".length); - const example = getPlaygroundExamples() - .flatMap((e) => e.examples) - .find((e) => e.id === exampleName); - if (example) { - this.model.selectedExample = example; - } + } else if ((example = findExample(hashValue))) { + this.model.selectedExample = example; } else { let p: IPlaygroundProject | undefined = undefined; if (this.cachedState?.hash === hashValue) {