Skip to content

Commit

Permalink
Fix #38
Browse files Browse the repository at this point in the history
  • Loading branch information
teodesian committed Aug 31, 2021
1 parent f74a5cf commit 9c38f26
Show file tree
Hide file tree
Showing 15 changed files with 541 additions and 424 deletions.
51 changes: 0 additions & 51 deletions Changes

This file was deleted.

1 change: 1 addition & 0 deletions Changes
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2020 Troglodyne LLC
Copyright (c) 2021 Troglodyne LLC

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
3 changes: 3 additions & 0 deletions MANIFEST.SKIP
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,6 @@ example.pl
tidyall.ini
generate_api_json.sh
api.json
playwright_server
generate_perl_modules.pl
clean_generated_files.sh
8 changes: 6 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,18 +46,22 @@ dzil authordeps --missing | sudo cpanm
dzil listdeps --missing | sudo cpanm
```

Actually running stuff:
Running dzil test should let you know if your kit is good to develop.

Actually running stuff will look like this after you generate the API json and modules:

`PATH="$(pwd)/bin:$PATH" perl -Ilib example.pl`

## Dealing with api.json
## Dealing with api.json and generating modules

Playwright doesn't ship their api.json with the distribution on NPM.
You have to generate it from their repo.

clone it in a directory that is the same as the one containing this repository.
then run `generate_api_json.sh` to get things working such that the build scripts know what to do.

Then run `generate_perl_modules.pl` to get the accessor classes built based off of the spec, and insert the spec JSON into the playwright_server binary.

## Questions?
Hop into the playwright slack, and check out the #playwright-perl channel therein.
I'm watching that space and should be able to answer your questions.
Expand Down
235 changes: 0 additions & 235 deletions bin/playwright_server

This file was deleted.

8 changes: 8 additions & 0 deletions clean_generated_files.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#!/bin/bash
rm api.json; /bin/true
rm bin/playwright_server; /bin/true
rmdir bin; /bin/true
for module in $(git ls-files -o --exclude-standard lib/Playwright)
do
rm $module; /bin/true
done
55 changes: 55 additions & 0 deletions conf/Changes
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
Revision history for Playwright

0.013 2021-08-31 TEODESIAN
- Statically generate playwright subclasses so that callers can easily wrap them with MOPs.
- allow evaluate() to be called on ElementHandles

0.012 2021-08-03 TEODESIAN
- Automatically translate element handles passed as args objects to the playwright process.

0.011 2021-07-27 TEODESIAN
- Make no attempts whatsoever to install node deps for users, instead giving them advice how to self-service fix their problems.

0.010 2021-07-27 TEODESIAN
- Fix issue with yargs fix breaking invocation in Playwright.pm
- Fix issue with child selectors being broken
- Add ability to specify library path

0.009 2021-07-26 TEODESIAN
- Remove dependency on yargs in bin/playwright_server

0.008 2021-07-16 TEODESIAN
- Add parent attribute to grab element parents when needed
- Remove dependency on AsyncData in favor of File::Temp, Sereal and fork().
- Prevent destructors for other objects firing in forks used to do asynchronous operations.

0.007 2021-06-17 TEODESIAN
- Adjust module for changing Download returns, and api.json no longer being shipped with Playwright
- Fix some warnings when installing for the first time.

0.006 2021-04-12 TEODESIAN
- Prevent $? from bubbling up in our destructor and invalidating program exit code by localizing $? in quit()
- Add a link to the Playwright slack in the documentation.

0.005 2021-03-24 TEODESIAN
[BUG FIXES]
- Prevent double destroy in the event of quit() being called
- Make the destroy() process a good deal more reliable
- Add a timeout parameter to new() to control how long to wait for the server to spin up/down
- Improve documentation
- Adjust auto-install process to work better on windows, and not leak stderr in some contexts.

0.004 2021-03-19 TEODESIAN
[BUG FIXES]
- Adjust spec parser for newer Playwright spec versions

0.003 2021-03-16 TEODESIAN
[BUG FIXES]
- Fix broken testsuite

0.002 2021-02-10 TEODESIAN
[BUG FIXES]
- Declare perl 5.28 to be minimum version

0.001 2020-11-02 TEODESIAN
- First release to CPAN
1 change: 1 addition & 0 deletions conf/perlcriticrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
exclude = RequireUseStrict|RequireUseWarnings|ProhibitSubroutinePrototypes
42 changes: 31 additions & 11 deletions dist.ini
Original file line number Diff line number Diff line change
@@ -1,21 +1,47 @@
name = Playwright
version = 0.012
version = 0.013
author = George S. Baugh <[email protected]>
license = MIT
copyright_holder = Troglodyne LLC
copyright_year = 2020
copyright_year = 2021

[GatherDir]
include_dotfiles = 1
[Run::BeforeBuild]
run = npm i
run = sudo npx playwright install-deps
run = ./generate_api_json.sh
run = ./generate_perl_modules.pl
run = PATH="$(pwd)/bin:$PATH" perl -Ilib example.pl

[Run::AfterBuild]
run = ./clean_generated_files.sh

[GatherDir / LibFiles ]
include_untracked = 1
exclude_match = .*\.swp
exclude_match = .*\.swo
root = ./lib
prefix = lib

[GatherDir / BuildConf ]
root = ./conf
prefix = .

[GatherDir / BinFiles ]
include_untracked = 1
root = ./bin
prefix = bin

[GatherDir / TestFiles ]
root = ./t
prefix = t

[PruneCruft]
except = \.travis.yml

[ManifestSkip]
[MetaYAML]
[MetaJSON]
[License]
[Readme]
[InstallGuide]
[ExtraTests]
Expand All @@ -33,6 +59,7 @@ finder = :InstallModules ;

[PodWeaver]
finder=NoBin

[Git::Contributors]
[TidyAll]

Expand All @@ -54,19 +81,12 @@ disable = Test::Synopsis

[Prereqs / RuntimeRequires]
perl = 5.010
Moo = 1.005
List::Util = 1.33

[GithubMeta]
issues = 1
user = teodesian

[Encoding]
filename = t/www/icon.gif
filename = t/www/invalid-extension.xpi
filename = t/www/redisplay.xpi
encoding = bytes

; `dzil authordeps` doesn't know about the Pod Weaver dependencies:
; authordep Pod::Weaver::Section::Contributors = 0
; authordep Pod::Weaver::Plugin::Encoding = 0
Expand Down
6 changes: 6 additions & 0 deletions generate_api_json.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
#!/bin/bash
# Relies on the user having cloned the playwright repository in the directory directly adjacent to this repo
./clean_generated_files.sh
mkdir bin; /bin/true
pushd ../playwright
git pull
node utils/doclint/generateApiJson.js > ../playwright-perl/api.json
popd
cp playwright_server bin/playwright_server
API="$(<api.json)"
sed -i -e '/%REPLACEME%/r api.json' -e 's/%REPLACEME%//g' bin/playwright_server
Loading

0 comments on commit 9c38f26

Please sign in to comment.