Skip to content

Commit c9c1683

Browse files
zyzyzyryxydependabot[bot]Piotr Paulski
authored
chore(deps-dev): bump chrome-devtools-frontend from 1.0.1613625 to 1.0.1616061 (#1952)
Closes #1908 --------- Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Piotr Paulski <piotrpaulski@chromium.org>
1 parent 5aa6437 commit c9c1683

3 files changed

Lines changed: 44 additions & 6 deletions

File tree

package-lock.json

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@
6363
"@types/yargs": "^17.0.33",
6464
"@typescript-eslint/eslint-plugin": "^8.43.0",
6565
"@typescript-eslint/parser": "^8.43.0",
66-
"chrome-devtools-frontend": "1.0.1613625",
66+
"chrome-devtools-frontend": "1.0.1618066",
6767
"core-js": "3.49.0",
6868
"debug": "4.4.3",
6969
"eslint": "^9.35.0",

scripts/post-build.ts

Lines changed: 39 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,12 @@ export const LOCAL_FETCH_PATTERN = './locales/@LOCALE@.json';`;
5252
);
5353
fs.mkdirSync(codeMirrorDir, {recursive: true});
5454
const codeMirrorFile = path.join(codeMirrorDir, 'codemirror.next.js');
55-
const codeMirrorContent = `export default {}`;
55+
const codeMirrorContent = `
56+
export default {};
57+
export const cssStreamParser = () => Promise.resolve({ startState: () => ({}) });
58+
export class StringStream { constructor() {} }
59+
export const css = { cssLanguage: { parser: { parse: () => ({ topNode: { getChild: () => null } }) } } };
60+
`;
5661
writeFile(codeMirrorFile, codeMirrorContent);
5762

5863
// Create root mock
@@ -61,7 +66,13 @@ export const LOCAL_FETCH_PATTERN = './locales/@LOCALE@.json';`;
6166
const runtimeFile = path.join(rootDir, 'Runtime.js');
6267
const runtimeContent = `
6368
export function getChromeVersion() { return ''; };
69+
export function getRemoteBase() { return null; };
6470
export const hostConfig = {};
71+
export const GdpProfilesEnterprisePolicyValue = {
72+
ENABLED: 0,
73+
ENABLED_WITHOUT_BADGES: 1,
74+
DISABLED: 2,
75+
};
6576
export const Runtime = {
6677
isDescriptorEnabled: () => true,
6778
queryParam: () => null,
@@ -94,6 +105,33 @@ export const ExperimentName = {
94105
`;
95106
writeFile(runtimeFile, runtimeContent);
96107

108+
// Copy missing CodeMirror .mjs files that tsc ignores due to .d.mts renames
109+
const codemirrorDir = path.join(
110+
BUILD_DIR,
111+
devtoolsThirdPartyPath,
112+
'codemirror',
113+
);
114+
const codemirrorSrcDir = path.join(
115+
process.cwd(),
116+
'node_modules',
117+
'chrome-devtools-frontend',
118+
'front_end',
119+
'third_party',
120+
'codemirror',
121+
);
122+
const filesToCopy = [
123+
'package/addon/runmode/runmode-standalone.mjs',
124+
'package/mode/css/css.mjs',
125+
'package/mode/javascript/javascript.mjs',
126+
'package/mode/xml/xml.mjs',
127+
];
128+
for (const file of filesToCopy) {
129+
const src = path.join(codemirrorSrcDir, file);
130+
const dest = path.join(codemirrorDir, file);
131+
fs.mkdirSync(path.dirname(dest), {recursive: true});
132+
fs.copyFileSync(src, dest);
133+
}
134+
97135
copyDevToolsDescriptionFiles();
98136
}
99137

0 commit comments

Comments
 (0)