Skip to content

Commit

Permalink
Merge pull request #240 from dshanske/dec22fixes
Browse files Browse the repository at this point in the history
Dev Dependencies Fixes
  • Loading branch information
pfefferle authored Sep 1, 2023
2 parents 7539633 + b2db145 commit 1057cf0
Show file tree
Hide file tree
Showing 5 changed files with 90 additions and 80 deletions.
99 changes: 39 additions & 60 deletions Gruntfile.js
Original file line number Diff line number Diff line change
@@ -1,63 +1,42 @@
module.exports = function (grunt) {
// Project configuration.
grunt.initConfig({
checktextdomain: {
options:{
text_domain: 'indieauth',
keywords: [
'__:1,2d',
'_e:1,2d',
'_x:1,2c,3d',
'esc_html__:1,2d',
'esc_html_e:1,2d',
'esc_html_x:1,2c,3d',
'esc_attr__:1,2d',
'esc_attr_e:1,2d',
'esc_attr_x:1,2c,3d',
'_ex:1,2c,3d',
'_n:1,2,4d',
'_nx:1,2,4c,5d',
'_n_noop:1,2,3d',
'_nx_noop:1,2,3c,4d'
]
},
files: {
src: [
'**/*.php', // Include all files
'includes/*.php', // Include includes
'!node_modules/**', // Exclude node_modules/
'!tests/**', // Exclude tests/
'!vendor/**', // Exclude vendor/
'!static/**', // Exclude static resources
],
expand: true
}
},
// Project configuration.
grunt.initConfig(
{
files: {
src: [
'**/*.php', // Include all files
'includes/*.php', // Include includes
'!node_modules/**', // Exclude node_modules/
'!tests/**', // Exclude tests/
'!vendor/**', // Exclude vendor/
'!static/**', // Exclude static resources
],
expand: true
},
wp_readme_to_markdown: {
target: {
files: {
'readme.md': 'readme.txt'
}
}
},
makepot: {
target: {
options: {
mainFile: 'indieauth.php',
domainPath: '/languages',
exclude: ['build/.*'],
potFilename: 'indieauth.pot',
type: 'wp-plugin',
updateTimestamp: true
}
}
}
}
);

wp_readme_to_markdown: {
target: {
files: {
'readme.md': 'readme.txt'
}
}
},
makepot: {
target: {
options: {
mainFile: 'indieauth.php',
domainPath: '/languages',
exclude: ['build/.*'],
potFilename: 'indieauth.pot',
type: 'wp-plugin',
updateTimestamp: true
}
}
}
});

grunt.loadNpmTasks('grunt-wp-readme-to-markdown');
grunt.loadNpmTasks('grunt-wp-i18n');
grunt.loadNpmTasks('grunt-checktextdomain');
// Default task(s).
grunt.registerTask('default', ['wp_readme_to_markdown', 'makepot', 'checktextdomain']);
grunt.loadNpmTasks( 'grunt-wp-readme-to-markdown' );
grunt.loadNpmTasks( 'grunt-wp-i18n' );
// Default task(s).
grunt.registerTask( 'default', ['wp_readme_to_markdown','makepot'] );
};
7 changes: 5 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,17 +28,20 @@
},
"require-dev": {
"squizlabs/php_codesniffer": "^2.2 || ^3.5",
"phpcompatibility/php-compatibility": "^9.3",
"phpcompatibility/php-compatibility": "*",
"wp-coding-standards/wpcs": "*",
"dealerdirect/phpcodesniffer-composer-installer": "^0.7",
"phpcompatibility/phpcompatibility-wp": "^2.1",
"phpcompatibility/phpcompatibility-wp": "*",
"sebastian/phpcpd": "^3.0 || ^4.0 || ^6.0",
"yoast/phpunit-polyfills": "^1.0"
},
"scripts": {
"install-codestandards": [
"Dealerdirect\\Composer\\Plugin\\Installers\\PHPCodeSniffer\\Plugin::run"
],
"post-install-cmd": [
"@install-codestandard"
],
"setup-local-tests": "bash bin/install-wp-tests.sh wordpress_test root root 127.0.0.1 latest",
"phpunit": "./vendor/bin/phpunit",
"test": [
Expand Down
8 changes: 4 additions & 4 deletions includes/class-indieauth-token-endpoint.php
Original file line number Diff line number Diff line change
Expand Up @@ -226,14 +226,14 @@ public function generate_token_response( $response ) {
$return['uuid'] = $response['uuid'];
}

$return['scope'] = $response['scope'];
$return['issued_by'] = rest_url( 'indieauth/1.0/token' );
$return['client_id'] = $response['client_id'];
$return['scope'] = $response['scope'];
$return['issued_by'] = rest_url( 'indieauth/1.0/token' );
$return['client_id'] = $response['client_id'];
if ( array_key_exists( 'id', $client ) ) {
$return['client_uid'] = $client['id'];
}

$return['iat'] = time();
$return['iat'] = time();

$expires = (int) get_option( 'indieauth_expires_in' );

Expand Down
3 changes: 1 addition & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,8 @@
},
"devDependencies": {
"grunt": "^1.0.4",
"grunt-checktextdomain": "^1.0.1",
"grunt-wp-i18n": "^1.0.3",
"grunt-wp-readme-to-markdown": "^2.0.1"
"grunt-wp-readme-to-markdown": "^2.1.0"
},
"license": "MIT",
"bugs": {
Expand Down
53 changes: 41 additions & 12 deletions phpcs.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,24 +2,53 @@
<ruleset name="WordPress Indieauth">
<description>WordPress Indieauth Standards</description>

<file>./indieauth.php</file>
<file>./includes/</file>
<file>./templates/</file>
<exclude-pattern>*/includes/*\.(inc|css|js|svg)</exclude-pattern>
<exclude-pattern>*/vendor/*</exclude-pattern>
<rule ref="PHPCompatibility"/>
<file>.</file>
<exclude-pattern>*\.(inc|css|js|svg)</exclude-pattern>
<!-- Exclude the Composer Vendor directory. -->
<exclude-pattern>/vendor/*</exclude-pattern>

<!-- Exclude the Node Modules directory. -->
<exclude-pattern>/node_modules/*</exclude-pattern>

<!-- Exclude the Test directory. -->
<exclude-pattern>/tests/*</exclude-pattern>

<!-- Exclude the Bin directory. -->
<exclude-pattern>/bin/*</exclude-pattern>

<!-- Strip the filepaths down to the relevant bit. -->
<arg name="basepath" value="."/>

<!-- Check up to 8 files simultaneously. -->
<arg name="parallel" value="8"/>


<!-- PHP/WordPress Compatibility Check -->
<config name="testVersion" value="5.6-"/>
<rule ref="PHPCompatibilityWP"/>
<config name="minimum_supported_wp_version" value="4.7"/>

<config name="minimum_supported_wp_version" value="4.9"/>


<rule ref="WordPress.WP.I18n">
<properties>
<property name="text_domain" type="array">
<element value="indieauth"/>
<element value="default"/>
</property>
</properties>
</rule>

<rule ref="WordPress.WP.DeprecatedFunctions" />
<rule ref="WordPress.WP.DeprecatedParameters" />
<rule ref="WordPress.WP.AlternativeFunctions" />

<rule ref="WordPress-Core" />
<rule ref="WordPress.Files.FileName">
<properties>
<property name="strict_class_file_names" value="false" />
</properties>
<properties>
<property name="strict_class_file_names" value="false" />
</properties>
</rule>

<rule ref="WordPress-Extra" />
<rule ref="WordPress.WP.I18n"/>
<config name="text_domain" value="indieauth,default"/>
</ruleset>

0 comments on commit 1057cf0

Please sign in to comment.