Skip to content

Commit

Permalink
#1030@trivial: Continues on implementation.
Browse files Browse the repository at this point in the history
  • Loading branch information
capricorn86 committed Sep 5, 2023
1 parent 095390e commit 9c2b136
Show file tree
Hide file tree
Showing 31 changed files with 1,120 additions and 132 deletions.
45 changes: 45 additions & 0 deletions package-lock.json

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

5 changes: 2 additions & 3 deletions packages/global-registrator/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
"compilerOptions": {
"outDir": "lib",
"rootDir": "src",
"tsBuildInfoFile": "tmp/.tsbuildinfo",
"target": "es2020",
"declaration": true,
"declarationMap": true,
Expand All @@ -19,8 +18,8 @@
"sourceMap": true,
"skipLibCheck": true,
"baseUrl": ".",
"composite": true,
"incremental": true,
"composite": false,
"incremental": false,
"jsx": "react",
"types": [
"node"
Expand Down
29 changes: 11 additions & 18 deletions packages/happy-dom/bin/change-file-extension.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -64,25 +64,18 @@ async function renameFiles(files, args) {
for (const file of newFiles) {
writePromises.push(
FS.promises.readFile(file.oldPath).then((content) => {
return FS.promises
.writeFile(
file.newPath,
content
.toString()
.replace(
new RegExp(`${args.fromExt.replace('.', '\\.')}\\.map`, 'g'),
`${args.toExt}.map`
)
.replace(
new RegExp(`${args.fromExt.replace('.', '\\.')}(["'])`, 'g'),
`${args.toExt}$1`
)
const oldContent = content.toString();
const newContent = oldContent
.replace(
new RegExp(`${args.fromExt.replace('.', '\\.')}\\.map`, 'g'),
`${args.toExt}.map`
)
.then(() => {
if (file.oldPath !== file.newPath) {
return FS.promises.unlink(file.oldPath);
}
});
.replace(new RegExp(`${args.fromExt.replace('.', '\\.')}(["'])`, 'g'), `${args.toExt}$1`);
return FS.promises.writeFile(file.newPath, newContent).then(() => {
if (file.oldPath !== file.newPath) {
return FS.promises.unlink(file.oldPath);
}
});
})
);
}
Expand Down
10 changes: 10 additions & 0 deletions packages/happy-dom/src/console/IVirtualConsoleLogEntry.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import IVirtualConsoleLogGroup from './IVirtualConsoleLogGroup.js';
import VirtualConsoleLogLevelEnum from './VirtualConsoleLogLevelEnum.js';
import VirtualConsoleLogTypeEnum from './VirtualConsoleLogTypeEnum.js';

export default interface IVirtualConsoleLogEntry {
type: VirtualConsoleLogTypeEnum;
level: VirtualConsoleLogLevelEnum;
message: Array<string | object>;
group: IVirtualConsoleLogGroup | null;
}
6 changes: 6 additions & 0 deletions packages/happy-dom/src/console/IVirtualConsoleLogGroup.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
export default interface IVirtualConsoleLogGroup {
id: number;
label: string;
collapsed: boolean;
parent: IVirtualConsoleLogGroup;
}
Loading

0 comments on commit 9c2b136

Please sign in to comment.