Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions package-lock.json

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

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@
"@types/yargs": "^17.0.33",
"@typescript-eslint/eslint-plugin": "^8.43.0",
"@typescript-eslint/parser": "^8.43.0",
"chrome-devtools-frontend": "1.0.1613625",
"chrome-devtools-frontend": "1.0.1618066",
"core-js": "3.49.0",
"debug": "4.4.3",
"eslint": "^9.35.0",
Expand Down
40 changes: 39 additions & 1 deletion scripts/post-build.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,12 @@ export const LOCAL_FETCH_PATTERN = './locales/@LOCALE@.json';`;
);
fs.mkdirSync(codeMirrorDir, {recursive: true});
const codeMirrorFile = path.join(codeMirrorDir, 'codemirror.next.js');
const codeMirrorContent = `export default {}`;
const codeMirrorContent = `
export default {};
export const cssStreamParser = () => Promise.resolve({ startState: () => ({}) });
export class StringStream { constructor() {} }
export const css = { cssLanguage: { parser: { parse: () => ({ topNode: { getChild: () => null } }) } } };
`;
writeFile(codeMirrorFile, codeMirrorContent);

// Create root mock
Expand All @@ -61,7 +66,13 @@ export const LOCAL_FETCH_PATTERN = './locales/@LOCALE@.json';`;
const runtimeFile = path.join(rootDir, 'Runtime.js');
const runtimeContent = `
export function getChromeVersion() { return ''; };
export function getRemoteBase() { return null; };
export const hostConfig = {};
export const GdpProfilesEnterprisePolicyValue = {
ENABLED: 0,
ENABLED_WITHOUT_BADGES: 1,
DISABLED: 2,
};
export const Runtime = {
isDescriptorEnabled: () => true,
queryParam: () => null,
Expand Down Expand Up @@ -94,6 +105,33 @@ export const ExperimentName = {
`;
writeFile(runtimeFile, runtimeContent);

// Copy missing CodeMirror .mjs files that tsc ignores due to .d.mts renames
Comment thread
zyzyzyryxy marked this conversation as resolved.
const codemirrorDir = path.join(
BUILD_DIR,
devtoolsThirdPartyPath,
'codemirror',
);
const codemirrorSrcDir = path.join(
process.cwd(),
'node_modules',
'chrome-devtools-frontend',
'front_end',
'third_party',
'codemirror',
);
const filesToCopy = [
'package/addon/runmode/runmode-standalone.mjs',
'package/mode/css/css.mjs',
'package/mode/javascript/javascript.mjs',
'package/mode/xml/xml.mjs',
];
for (const file of filesToCopy) {
const src = path.join(codemirrorSrcDir, file);
const dest = path.join(codemirrorDir, file);
fs.mkdirSync(path.dirname(dest), {recursive: true});
fs.copyFileSync(src, dest);
}

copyDevToolsDescriptionFiles();
}

Expand Down
Loading