Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Task/466 windowopen is not a function #1141

Merged
merged 65 commits into from
Jan 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
65 commits
Select commit Hold shift + click to select a range
b091da6
#466@trivial: Starts on implementation.
capricorn86 Sep 19, 2023
efdf26b
#466@trivial: Starts on implementation.
capricorn86 Sep 19, 2023
17cfde7
#466@trivial: Starts on implementation.
capricorn86 Sep 20, 2023
87e51e8
#466@trivial: Continue on implementation.
capricorn86 Oct 5, 2023
d17bdb6
Merge branch 'master' of https://github.com/capricorn86/happy-dom int…
capricorn86 Oct 5, 2023
0e8b0ed
#466@trivial: Continues on implementation.
capricorn86 Oct 5, 2023
531d18b
#466@trivial: Continues on implementation.
capricorn86 Oct 12, 2023
fc84978
#466@trivial: Continues on implementation.
capricorn86 Oct 18, 2023
8e23bd9
#466@trivial: Continues on implementation.
capricorn86 Oct 18, 2023
e2cc329
#466@trivial: Continues on implementation.
capricorn86 Oct 19, 2023
b0141ea
#466@trivial: Continues on implementation.
capricorn86 Oct 19, 2023
0c26663
#466@trivial: Continues on implementation.
capricorn86 Oct 22, 2023
c7b18ec
#466@trivial: Continues on implementation.
capricorn86 Oct 22, 2023
ac788a9
#466@trivial: Continues on implementation.
capricorn86 Oct 24, 2023
ebc5759
#466@trivial: Continues on implementation.
capricorn86 Oct 24, 2023
c911169
#466@trivial: Continues on implementation.
capricorn86 Oct 24, 2023
8ad1a0d
#466@trivial: Continues on implementation.
capricorn86 Oct 27, 2023
f1b7dd2
#466@trivial: Continues on implementation.
capricorn86 Oct 28, 2023
c3dff3f
#466@trivial: Continues on implementation.
capricorn86 Nov 1, 2023
1fc61c6
#466@trivial: Continues on implementation.
capricorn86 Nov 2, 2023
eda600f
#466@trivial: Continues on implementation.
capricorn86 Nov 2, 2023
81255d5
#466@trivial: Continues on implementation.
capricorn86 Nov 3, 2023
6d49f2c
#466@trivial: Continues on implementation.
capricorn86 Nov 11, 2023
4c4f732
#466@trivial: Continues on implementation.
capricorn86 Nov 13, 2023
e119f9f
#466@trivial: Continues on implementation.
capricorn86 Nov 14, 2023
bd6853b
#466@trivial: Continues on implementation.
capricorn86 Nov 14, 2023
91498b8
#466@trivial: Continues on implementation.
capricorn86 Nov 18, 2023
286b30e
#466@trivial: Continues on implementation.
capricorn86 Nov 21, 2023
b2c6e6a
#466@trivial: Continues on implementation.
capricorn86 Nov 21, 2023
7910996
#466@trivial: Continues on implementation.
capricorn86 Nov 22, 2023
3f686e6
#466@trivial: Continues on implementation.
capricorn86 Nov 28, 2023
aec9b09
#466@trivial: Continues on implementation.
capricorn86 Nov 28, 2023
4616615
#466@trivial: Continues on implementation.
capricorn86 Nov 28, 2023
853784d
#466@trivial: Continues on implementation.
capricorn86 Nov 28, 2023
5bd2638
#466@trivial: Continues on implementation.
capricorn86 Dec 6, 2023
1000154
#466@trivial: Continues on implementation.
capricorn86 Dec 10, 2023
141d567
#466@trivial: Continues on implementation.
capricorn86 Dec 11, 2023
494c670
#466@trivial: Continues on implementation.
capricorn86 Dec 12, 2023
0d86011
#466@trivial: Continues on implementation.
capricorn86 Dec 12, 2023
9ce48c2
#466@trivial: Continues on implementation.
capricorn86 Dec 14, 2023
3ef2c19
#466@trivial: Continues on implementation.
capricorn86 Dec 15, 2023
628e054
#466@trivial: Continues on implementation.
capricorn86 Dec 17, 2023
10424bf
#466@trivial: Continues on implementation.
capricorn86 Dec 18, 2023
b43781f
#466@trivial: Continues on implementation.
capricorn86 Dec 19, 2023
51bc7b3
#466@trivial: Continues on implementation.
capricorn86 Dec 20, 2023
d80c2c8
#466@trivial: Continues on implementation.
capricorn86 Dec 21, 2023
7e5b5d6
#466@trivial: Continues on implementation.
capricorn86 Dec 31, 2023
5ddf62b
#466@trivial: Continues on implementation.
capricorn86 Jan 3, 2024
051f6ac
#466@trivial: Continues on implementation.
capricorn86 Jan 4, 2024
6fe6ae7
#466@trivial: Continues on implementation.
capricorn86 Jan 6, 2024
575a6f0
#466@trivial: Continues on implementation.
capricorn86 Jan 8, 2024
e551845
#466@trivial: Continues on implementation.
capricorn86 Jan 8, 2024
d4403e3
#466@trivial: Continues on implementation.
capricorn86 Jan 8, 2024
f5de1bd
#466@trivial: Use symbols instead of __ for internal properties.
capricorn86 Jan 9, 2024
cbc347f
#466@trivial: Use symbols instead of __ for internal properties.
capricorn86 Jan 9, 2024
90b925b
#466@trivial: Use symbols instead of __ for internal properties.
capricorn86 Jan 9, 2024
07746c0
#466@trivial: Use symbols instead of __ for internal properties.
capricorn86 Jan 9, 2024
6227912
#466@trivial: Use symbols instead of __ for internal properties.
capricorn86 Jan 9, 2024
db3999b
#466@trivial: Fixes linting.
capricorn86 Jan 9, 2024
4264264
#466@trivial: Fixes MutationObserver and adds support for BrowserFram…
capricorn86 Jan 10, 2024
2211596
#466@trivial: Fixes MutationObserver and adds support for BrowserFram…
capricorn86 Jan 10, 2024
3a372de
Merge branch 'master' of https://github.com/capricorn86/happy-dom int…
capricorn86 Jan 10, 2024
f245b8b
#466@major: Adds support for Browser API.
capricorn86 Jan 10, 2024
c6ca530
#466@trivial: Adds unit tests for waitForNavigation().
capricorn86 Jan 10, 2024
32e144e
#466@trivial: Adds unit test for importNode().
capricorn86 Jan 10, 2024
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
186 changes: 186 additions & 0 deletions .eslintrc.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,186 @@
const WARN = "warn";
const ERROR = "error";
const OFF = "off";

const COMMON_CONFIG = {
plugins: ["jsdoc", "filenames", "import", "prettier"],
extends: ["prettier", "plugin:prettier/recommended"],
rules: {
"prettier/prettier": WARN,
"no-underscore-dangle": OFF,
"no-debugger": WARN,
"space-infix-ops": ERROR,
"no-console": WARN,
"wrap-iife": OFF,
"no-self-assign": ERROR,
"no-self-compare": ERROR,
"no-loop-func": OFF,
"array-callback-return": ERROR,
curly: ERROR,
"no-fallthrough": OFF,
"dot-notation": OFF,
"prefer-const": WARN,
"no-empty-function": OFF,
"no-with": ERROR,
"one-var": [ERROR, "never"],
camelcase: [WARN, { properties: "always", ignoreImports: true }],
"spaced-comment": [WARN, "always"],
"capitalized-comments": [WARN, "always", { ignorePattern: "prettier" }],
"no-useless-rename": WARN,
"jsdoc/check-alignment": WARN,
"jsdoc/check-examples": OFF,
"jsdoc/check-indentation": WARN,
"jsdoc/check-syntax": WARN,
"jsdoc/check-tag-names": WARN,
"jsdoc/check-types": WARN,
"jsdoc/implements-on-classes": WARN,
"jsdoc/match-description": OFF,
"jsdoc/newline-after-description": WARN,
"jsdoc/no-types": OFF,
"jsdoc/no-undefined-types": OFF,
"jsdoc/require-description": OFF,
"jsdoc/require-description-complete-sentence": OFF,
"jsdoc/require-example": OFF,
"jsdoc/require-hyphen-before-param-description": [WARN, "never"],
"jsdoc/require-param": WARN,
"jsdoc/require-param-name": WARN,
"jsdoc/require-returns-check": WARN,
"jsdoc/require-returns-description": WARN,
"jsdoc/valid-types": WARN,
"filenames/match-exported": WARN,
"no-useless-constructor": WARN,
"jsdoc/require-jsdoc": [
WARN,
{
require: {
ArrowFunctionExpression: false,
FunctionDeclaration: false,
FunctionExpression: false,
ClassDeclaration: true,
MethodDefinition: true,
},
},
],
"import/no-extraneous-dependencies": WARN,
},
};

const TS_PARSER_FIELDS = {
parser: "@typescript-eslint/parser",
parserOptions: {
ecmaFeatures: {
jsx: true,
},
ecmaVersion: 2020,
sourceType: "module",
},
};

module.exports = {
env: {
es6: true,
browser: true,
node: true,
},
overrides: [
{
files: ["*.js", "*.jsx", "*.mjs"],
...TS_PARSER_FIELDS,
plugins: COMMON_CONFIG.plugins,
extends: COMMON_CONFIG.extends,
rules: {
...COMMON_CONFIG.rules,
"no-undef": ERROR,
"jsdoc/check-param-names": WARN,
"jsdoc/require-param-type": WARN,
"jsdoc/require-returns": WARN,
"jsdoc/require-param-description": WARN,
"jsdoc/require-returns-type": WARN,
"consistent-return": WARN,
},
},
{
files: ["*.json"],
plugins: ["json"],
extends: ["eslint:recommended", "plugin:json/recommended"],
},
{
files: ["*.ts", "*.tsx"],
plugins: [...COMMON_CONFIG.plugins, "@typescript-eslint"],
...TS_PARSER_FIELDS,
extends: [
...COMMON_CONFIG.extends,
"plugin:@typescript-eslint/recommended",
],
rules: {
...COMMON_CONFIG.rules,
"@typescript-eslint/explicit-member-accessibility": [
ERROR,
{ overrides: { constructors: "no-public" } },
],
"@typescript-eslint/no-unused-vars": OFF, // TSC is already doing this
"@typescript-eslint/ban-types": OFF, // TSC is already doing this
"no-undef": OFF, // TSC is already doing this
"@typescript-eslint/no-var-requires": OFF,
"@typescript-eslint/explicit-module-boundary-types": OFF, // TSC is already doing this
"@typescript-eslint/consistent-type-assertions": [
WARN,
{ assertionStyle: "angle-bracket" },
],
"@typescript-eslint/no-explicit-any": OFF,
"@typescript-eslint/no-empty-function": OFF,
"@typescript-eslint/no-use-before-define": OFF,
"@typescript-eslint/no-this-alias": OFF,
"@typescript-eslint/explicit-function-return-type": [
ERROR,
{ allowExpressions: true },
],
"@typescript-eslint/member-ordering": [
WARN,
{
default: [
"signature",
"field",
"constructor",
["get", "set"],
"method",
],
},
],
"@typescript-eslint/ban-ts-comment": OFF,
"jsdoc/no-types": WARN,
"import/named": OFF,
"import/no-named-as-default": WARN,
"import/no-extraneous-dependencies": WARN,
"import/no-absolute-path": WARN,
"@typescript-eslint/naming-convention": [
WARN,
{
selector: "interface",
format: ["PascalCase"],
prefix: ["I"],
},
{
selector: "enum",
format: ["PascalCase"],
suffix: ["Enum"],
},
{
selector: "typeParameter",
format: ["PascalCase"],
},
{
selector: "memberLike",
modifiers: ["private"],
leadingUnderscore: "allow",
format: ["camelCase"],
},
{
selector: "class",
format: ["PascalCase"],
},
],
},
},
],
};
2 changes: 1 addition & 1 deletion .huskyrc.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"hooks": {
"pre-commit": "npm run lint:fix",
"pre-commit": "npm run lint:changed",
"commit-msg": "node ./bin/husky-commit-message.js --filepath=$HUSKY_GIT_PARAMS%HUSKY_GIT_PARAMS%"
}
}
5 changes: 5 additions & 0 deletions .lintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
**/node_modules
**/tmp
**/lib
**/cjs
**/tmp
74 changes: 46 additions & 28 deletions bin/generate-release-notes.js
Original file line number Diff line number Diff line change
@@ -1,59 +1,77 @@
#!/bin/env node
'use strict';
"use strict";

const GitUtility = require('../build/GitUtility');
const FS = require('fs');
const Path = require('path');
const GitUtility = require("../build/GitUtility");
const FS = require("fs");
const Path = require("path");

process.on('unhandledRejection', error => {
/* eslint-disable no-console*/

process.on("unhandledRejection", (error) => {
console.error(error);
process.exit(1);
});

async function main() {
const nextVersion = process.argv.find(text => text.startsWith('--next-version=')).split('=').reverse()[0];
const latestVersion = process.argv.find(text => text.startsWith('--latest-version=')).split('=').reverse()[0];
const nextVersion = process.argv
.find((text) => text.startsWith("--next-version="))
.split("=")
.reverse()[0];
const latestVersion = process.argv
.find((text) => text.startsWith("--latest-version="))
.split("=")
.reverse()[0];

const commitMessages = await GitUtility.getCommitMessages('v' + latestVersion, 'v' + nextVersion);
const commitMessages = await GitUtility.getCommitMessages(
"v" + latestVersion,
"v" + nextVersion
);
const commits = { trivial: [], patch: [], minor: [], major: [] };
const duplicates = { trivial: [], patch: [], minor: [], major: [] };

for (const commitMessage of commitMessages) {
const parsed = GitUtility.parseCommitMessage(commitMessage);

if (parsed.commit && !parsed.errors.length && !duplicates[parsed.commit.versionType].includes(parsed.commit.description)) {

if (
parsed.commit &&
!parsed.errors.length &&
!duplicates[parsed.commit.versionType].includes(parsed.commit.description)
) {
commits[parsed.commit.versionType].push(parsed.commit);
duplicates[parsed.commit.versionType].push(parsed.commit.description);
}
}
let output = [];
if(commits.major.length > 0) {
let notes = '### :bomb: Breaking Changes\n\n'
for(const commit of commits.major) {

const output = [];

if (commits.major.length > 0) {
let notes = "### :bomb: Breaking Changes\n\n";
for (const commit of commits.major) {
notes += ` - ${commit.description} (${commit.taskId})\n`;
}
output.push(notes);
}
if(commits.minor.length > 0) {
let notes = '### :art: Features\n\n'
for(const commit of commits.minor) {

if (commits.minor.length > 0) {
let notes = "### :art: Features\n\n";
for (const commit of commits.minor) {
notes += ` - ${commit.description} (${commit.taskId})\n`;
}
output.push(notes);
}
if(commits.patch.length > 0) {
let notes = '### :construction_worker_man: Patch fixes\n\n';
for(const commit of commits.patch) {

if (commits.patch.length > 0) {
let notes = "### :construction_worker_man: Patch fixes\n\n";
for (const commit of commits.patch) {
notes += ` - ${commit.description} (${commit.taskId})\n`;
}
output.push(notes);
}

await FS.promises.writeFile(Path.resolve('RELEASE_NOTES.md'), output.join('\n\n'));

await FS.promises.writeFile(
Path.resolve("RELEASE_NOTES.md"),
output.join("\n\n")
);
}

main();
main();
36 changes: 21 additions & 15 deletions bin/husky-commit-message.js
Original file line number Diff line number Diff line change
@@ -1,41 +1,47 @@
#!/bin/env node
'use strict';
"use strict";

const Fs = require('fs');
const Path = require('path');
const Chalk = require('chalk');
const GitUtility = require('../build/GitUtility');
const Fs = require("fs");
const Path = require("path");
const Chalk = require("chalk");
const GitUtility = require("../build/GitUtility");

process.on('unhandledRejection', error => {
/* eslint-disable no-console*/

process.on("unhandledRejection", (error) => {
console.error(error);
process.exit(1);
});

async function main() {
const argument = process.argv.find(text => text.startsWith('--filepath='));
const filepath = argument ? argument
.split(/=/)[1]
.replace('%HUSKY_GIT_PARAMS%', '')
.replace('$HUSKY_GIT_PARAMS', '') : null;
const argument = process.argv.find((text) => text.startsWith("--filepath="));
const filepath = argument
? argument
.split(/=/)[1]
.replace("%HUSKY_GIT_PARAMS%", "")
.replace("$HUSKY_GIT_PARAMS", "")
: null;

if (!filepath) {
throw new Error('Failed to validate commit message. The argument "--filepath=" was not provided.');
throw new Error(
'Failed to validate commit message. The argument "--filepath=" was not provided.'
);
}

const commitBuffer = await Fs.promises.readFile(Path.resolve(filepath));
const commitMessage = GitUtility.parseCommitMessage(commitBuffer.toString());

if (commitMessage.errors.length > 0) {
console.error(Chalk.red('\nCommit message validation failed:'));
console.error(Chalk.red("\nCommit message validation failed:"));

for (const error of commitMessage.errors) {
console.error(Chalk.red(` ✖ ${error}`));
}

console.log('');
console.log("");

process.exit(1);
}
}

main();
main();
10 changes: 6 additions & 4 deletions bin/print-latest-version.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
#!/bin/env node
'use strict';
"use strict";

const GitUtility = require('../build/GitUtility');
const GitUtility = require("../build/GitUtility");

process.on('unhandledRejection', error => {
/* eslint-disable no-console*/

process.on("unhandledRejection", (error) => {
console.error(error);
process.exit(1);
});
Expand All @@ -13,4 +15,4 @@ async function main() {
process.stdout.write(latestVersion);
}

main();
main();
Loading