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

BREAKING: Refactor whole codebase #145

Open
wants to merge 35 commits into
base: main
Choose a base branch
from
Open
Changes from 1 commit
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
72949ea
Replace assertNoConsoleErrors with consoleErrors
ebebbington Apr 30, 2024
7f7da27
completely refactor, huge breaking changes, simpler api
ebebbington May 2, 2024
eee446a
update chrome version
ebebbington May 2, 2024
30fc43c
revert chrome upgrade
ebebbington May 2, 2024
e6f7db9
catch edge case of no object id for query selector
ebebbington May 2, 2024
c9d0b1d
fix closing an already closed process
ebebbington May 4, 2024
9966637
fix tests
ebebbington May 4, 2024
d2d639a
revert jsr
ebebbington May 4, 2024
c096860
tidy up
ebebbington May 4, 2024
2d10639
refactor more
ebebbington May 15, 2024
1f359c8
more
ebebbington May 15, 2024
d3e6516
update readme
ebebbington May 15, 2024
388e4f3
add bumper
ebebbington May 15, 2024
8e62dfb
emove console tests
ebebbington May 15, 2024
2b7766b
fmt
ebebbington May 15, 2024
666026e
Add catch and more tests
ebebbington May 15, 2024
46ddf12
fix src
ebebbington May 15, 2024
c7231e9
fix tests
ebebbington May 15, 2024
6367c62
Fix tests
ebebbington May 15, 2024
eddd961
update readme
ebebbington May 15, 2024
74c3cf6
add timeout handler
ebebbington May 15, 2024
9a73d39
update
ebebbington May 15, 2024
6f51e56
Merge branch 'main' of github.com:drashland/sinco into change-console…
ebebbington May 15, 2024
ec329f0
rm bumper
ebebbington May 15, 2024
d031cd8
cleanup mod.ts
ebebbington May 16, 2024
7424cdc
rm dead code
ebebbington May 16, 2024
627472e
make mod.ts simpler
ebebbington May 16, 2024
5d2a7ba
correct tests
ebebbington May 16, 2024
a7cdd0f
rm unused property
ebebbington May 16, 2024
2fad7a9
update readme
ebebbington May 24, 2024
3b63f2b
fmt
ebebbington May 24, 2024
9ed8171
refactor more
ebebbington May 25, 2024
7ef05f7
update Readme
ebebbington May 25, 2024
ade97ac
fmt
ebebbington May 25, 2024
204f1a8
update some deps
ebebbington May 25, 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
Prev Previous commit
Next Next commit
cleanup mod.ts
ebebbington committed May 16, 2024
commit d031cd8f192dc2339a64cae1a4fa713a66bbe597
27 changes: 15 additions & 12 deletions mod.ts
Original file line number Diff line number Diff line change
@@ -12,14 +12,16 @@ const defaultOptions = {
};

export async function build(
options: BuildOptions = defaultOptions,
{
hostname = "localhost",
debuggerPort = 9292,
binaryPath,
}: BuildOptions = defaultOptions,
): Promise<{
browser: Client;
page: Page;
}> {
if (!options.debuggerPort) options.debuggerPort = 9292;
if (!options.hostname) options.hostname = "localhost";
const buildArgs = getChromeArgs(options.debuggerPort);
const buildArgs = getChromeArgs(debuggerPort, binaryPath);
const path = buildArgs.splice(0, 1)[0];
const command = new Deno.Command(path, {
args: buildArgs,
@@ -30,21 +32,22 @@ export async function build(

return await Client.create(
{
hostname: options.hostname,
port: options.debuggerPort,
hostname,
port: debuggerPort,
},
browserProcess,
);
}

export async function connect(options: BuildOptions = defaultOptions) {
if (!options.debuggerPort) options.debuggerPort = 9292;
if (!options.hostname) options.hostname = "localhost";

export async function connect({
hostname = "localhost",
debuggerPort = 9292,
}: BuildOptions = defaultOptions) {
console.log(hostname, debuggerPort);
return await Client.create(
{
hostname: options.hostname,
port: options.debuggerPort,
hostname,
port: debuggerPort,
},
);
}