-
Notifications
You must be signed in to change notification settings - Fork 1
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
Amphtml generator update #6
base: master
Are you sure you want to change the base?
Conversation
…s API for parse().
Lock masterminds/html5 to prevent jumping to 2.4 version
config.vm.provider "virtualbox" do |vb| | ||
vb.memory = "1024" | ||
end | ||
end |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This Vagrant file is used to download all dependencies inside a VM. We could have an alternative docker file.
require_once ($autoload); | ||
break; | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Allow the script to work from different folders
cp dist/validator-generated.php $PROJECT_PATH/src/Spec/ | ||
|
||
echo "Generated files" | ||
ls $PROJECT_PATH/src/Spec/*.php |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Adapted version of https://github.com/Automattic/amp-wp/blob/develop/bin/amphtml-update.sh
This script generates both the WP and Lullabot versions of validation rules
GeneratePHP(out_dir) | ||
|
||
if __name__ == '__main__': | ||
Main() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Adapted version of https://github.com/Lullabot/amphtml/blob/php-validator-generated/validator/validator_gen_php.py
This file can run as standalone
@@ -15,7 +15,7 @@ | |||
"querypath/QueryPath": ">=3.0.4", | |||
"sebastian/diff": "^1.2 || ^2 || ^3", | |||
"marc1706/fast-image-size": "1.*", | |||
"masterminds/html5": "^2.2.0", | |||
"masterminds/html5": "~2.0", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See comments here Lullabot#249
{ | ||
// We embed a scanner so that $this->startTag() knows the current line number | ||
$this->scanner = new Scanner($inputstream); | ||
$this->scanner = new Scanner($data); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See comments here Lullabot#249
{ | ||
// User options override default options in $this->options | ||
$final_options = array_merge($this->options, $options); | ||
$amp_tree_builder = new AMPDOMTreeBuilder($inputstream, $final_options); | ||
$amp_tree_builder = new AMPDOMTreeBuilder($data, $final_options); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See comments here Lullabot#249
}, | ||
"bin": [ | ||
"bin/amp-console" | ||
] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Put the executable inside vendor/bin
On this pull request I did the following:
See Lullabot#231