Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
c4b354f
fix: replace react-sortable-hoc with @dnd-kit and resolve TypeScript …
hristvic-tieto Sep 17, 2025
88332e1
Update package dependencies: add @emotion/stylis and stylis, remove @…
hristvic-tieto Sep 18, 2025
29d0d04
Upgrade WordPress and webpack dependencies for improved ESM support, …
hristvic-tieto Sep 24, 2025
c2897ab
chore: update dependencies to latest versions
hristvic-tieto Oct 2, 2025
387e8ed
fix: update webpack configuration to include WebpackManifestPlugin an…
hristvic-tieto Oct 2, 2025
d0d5da1
refactor: update component imports and types for improved clarity and…
hristvic-tieto Oct 2, 2025
2be63ba
Add lightweight wp-env local development environment
kadamwhite Apr 6, 2026
613a10d
Add lodash as editor bundle dependency
kadamwhite Apr 6, 2026
f000e41
Indentation for env commands
kadamwhite Apr 6, 2026
4456d64
Install wp-scripts and remove legacy npm dependencies
kadamwhite Apr 6, 2026
afcaf91
Configure src directory to build with wp-scripts
kadamwhite Apr 6, 2026
5650135
Remove Asset Loader dependency, load script directly using asset.php …
kadamwhite Apr 6, 2026
d342dc4
ESLint: Avoid shadowing parent-scope "options" identifier
kadamwhite Apr 6, 2026
3a8c0bc
Restore functionality of lint:js script using "wp-scripts lint-js"
kadamwhite Apr 6, 2026
7f1fb33
Fix other shadow instance
kadamwhite Apr 6, 2026
3d7b374
ESLint: Do not warn on casing of "post_type" key which needs to match…
kadamwhite Apr 6, 2026
ef312e9
ESLint: Temporarily suppress warning about event listeners on <div> e…
kadamwhite Apr 6, 2026
de0a2bf
ESLint: Allow shadowing where it improves readability of update funct…
kadamwhite Apr 6, 2026
a37f779
Stylelint: Update "npm run lint:css" rule to use "wp-scripts lint-sty…
kadamwhite Apr 6, 2026
82365e1
Remove references to no-longer-necessary lib/ directory
kadamwhite Apr 6, 2026
850ce70
Update publicly-documented supported Node version
kadamwhite Apr 6, 2026
87bd580
Switch build and start commands to use wp-scripts
kadamwhite Apr 6, 2026
860c4fa
Use "asset" instead of "script" in identifier for .asset.php file
kadamwhite Apr 6, 2026
dfe1e5f
Inject runtime asset when present to enable HMR support
kadamwhite Apr 6, 2026
880a2d4
Remove legacy webpack build
kadamwhite Apr 6, 2026
d1c729b
Simplify HMR-mode detection within enqueue_assets_for_post
kadamwhite Apr 6, 2026
a234ed4
Merge branch 'develop' into build-updates
kadamwhite Apr 7, 2026
ff66661
ESLint: Move post_type to allowed nonCamelCase variable identifier list
kadamwhite Apr 7, 2026
4d33b02
Remove lib/ directory from phpstan scan list
kadamwhite Apr 7, 2026
b996a8a
Rename style.scss so that editor_asset[version] will also reflect CSS…
kadamwhite Apr 7, 2026
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
1 change: 0 additions & 1 deletion .babelrc.js

This file was deleted.

41 changes: 0 additions & 41 deletions .config/webpack.config.dev.js

This file was deleted.

19 changes: 0 additions & 19 deletions .config/webpack.config.prod.js

This file was deleted.

30 changes: 0 additions & 30 deletions .config/webpack.shared.js

This file was deleted.

24 changes: 14 additions & 10 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,6 @@
{
"parser": "@typescript-eslint/parser",
"extends": [
"@humanmade",
"plugin:@typescript-eslint/recommended"
],
"plugins": [
"@typescript-eslint"
"plugin:@wordpress/eslint-plugin/recommended"
],
"rules": {
"@typescript-eslint/no-unused-vars": [ "warn", {
Expand All @@ -14,22 +9,31 @@
"ignoreRestSiblings": true
} ],
"@typescript-eslint/no-use-before-define": [ "error" ],

"jsdoc/require-jsdoc": [ "error", {
"require": {
"FunctionDeclaration": true
}
} ],

// Superseded by TypeScript.
"jsdoc/check-tag-names": "warn",
"jsdoc/require-param": "off",
"jsdoc/require-param-type": "off",
"jsdoc/require-returns": "off",

"camelcase": [ "error", { "allow": [ "^WP_REST_API_", "post_type" ] } ],
"no-unused-vars": "off",
"no-use-before-define": "off"
"no-use-before-define": "off",
"prettier/prettier": "off"
},
"settings": {
"jsdoc": {
"tagNamePreference": {
"return": "returns"
}
}
},
"ignorePatterns": [
"build/**",
"lib/**",
"node_modules/**",
"tests/wordpress/**",
"vendor/**"
Expand Down
1 change: 0 additions & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,6 @@ jobs:
git config user.email github-actions@github.com
git checkout -b "release-$VERSION"
git add -f build/*
git add -f lib/*
git commit -m "Release $VERSION"
git tag "$VERSION"
git push --tags
Expand Down
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
# Directories:

/build/
/lib/
/node_modules/
/tests/cache/
/tests/wordpress/
Expand Down
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v16
v24
9 changes: 6 additions & 3 deletions .stylelintrc.json
Original file line number Diff line number Diff line change
@@ -1,13 +1,16 @@
{
"extends": "@humanmade/stylelint-config",
"extends": "@wordpress/stylelint-config/scss-stylistic",
"rules": {
"declaration-property-unit-blacklist": null,
"@stylistic/max-line-length": null,
"max-nesting-depth": null,
"rule-empty-line-before": null,
"selector-class-pattern": null
},
"ignoreFiles": [
"**/*.json",
"**/*.ts",
"**/*.tsx",
"build/**",
"lib/**",
"node_modules/**",
"tests/wordpress/**",
"vendor/**"
Expand Down
11 changes: 11 additions & 0 deletions .wp-env.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"port": 3001,
"testsEnvironment": false,
"config": {
"WP_DEBUG": true,
"WP_DEBUG_DISPLAY": false,
"WP_DEVELOPMENT_MODE": "plugin",
"SCRIPT_DEBUG": true
},
"plugins": [ "." ]
}
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ _Features without a checkmark are still work in progress._
### For development use

* Clone this repo into your plugins directory
* Ensure you have Composer v2 and Node v16 installed
* Ensure you have Composer v2 and Node v24 installed
* Install the dependencies:
`composer install && npm install`
* Start the dev server:
Expand Down
8 changes: 1 addition & 7 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,7 @@
"type": "wordpress-plugin",
"require": {
"php": ">=7.2",
"composer/installers": "^1.0 || ^2.0",
"humanmade/asset-loader": "^0.5.0 || ^0.6.1"
"composer/installers": "^1.0 || ^2.0"
},
"require-dev": {
"dealerdirect/phpcodesniffer-composer-installer": "0.7.0",
Expand Down Expand Up @@ -43,11 +42,6 @@
"sort-packages": true
},
"extra": {
"installer-paths": {
"lib/{$name}/": [
"humanmade/asset-loader"
]
},
"wordpress-install-dir": "tests/wordpress"
},
"scripts": {
Expand Down
40 changes: 3 additions & 37 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

55 changes: 32 additions & 23 deletions inc/namespace.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,6 @@
use WP_REST_Server;
use WP_User;

use function Asset_Loader\enqueue_asset;

const GUEST_ROLE = 'guest-author';
const POSTS_PARAM = 'authorship';
const REST_CURIE_TEMPLATE = 'https://authorship.hmn.md/{rel}';
Expand Down Expand Up @@ -504,32 +502,43 @@
* Enqueues the JS and CSS assets for the author selection control.
*/
function enqueue_assets_for_post(): void {
$manifest = plugin_dir_path( __DIR__ ) . 'build/asset-manifest.json';
$editor_asset = include plugin_dir_path( __DIR__ ) . 'build/index.asset.php';
if ( empty( $editor_asset ) ) {
trigger_error( 'Asset file missing, rebuild plugin asset bundles', E_USER_WARNING );
return;
}

// Hot-reloading support.
$runtime_asset = include plugin_dir_path( __DIR__ ) . 'build/runtime.asset.php';
if ( ! empty( $runtime_asset ) && in_array( 'wp-react-refresh-runtime', $editor_asset['dependencies'] ?? [], true ) ) {
wp_register_script(
'authorship-hmr-runtime',
plugins_url( 'build/runtime.js', __DIR__ ),
$runtime_asset['dependencies'],
$runtime_asset['version'],
[

Check failure on line 519 in inc/namespace.php

View workflow job for this annotation

GitHub Actions / PHP Coding Standards

Parameter #5 $in_footer of function wp_register_script expects bool, array<string, true> given.
'in_footer' => true,
]
);
$editor_asset['dependencies'][] = 'authorship-hmr-runtime';
}

enqueue_asset(
$manifest,
'main.js',
wp_enqueue_script(
SCRIPT_HANDLE,
plugins_url( 'build/index.js', __DIR__ ),
$editor_asset['dependencies'],
$editor_asset['version'],
[

Check failure on line 531 in inc/namespace.php

View workflow job for this annotation

GitHub Actions / PHP Coding Standards

Parameter #5 $in_footer of function wp_enqueue_script expects bool, array<string, true> given.
'handle' => SCRIPT_HANDLE,
// @TODO check:
'dependencies' => [
'react',
'wp-block-editor',
'wp-blocks',
'wp-components',
'wp-element',
'wp-i18n',
'wp-polyfill',
],
'defer' => true,
'in_footer' => true,
]
);

enqueue_asset(
$manifest,
'style.css',
[
'handle' => STYLE_HANDLE,
]
wp_enqueue_style(
STYLE_HANDLE,
plugins_url( 'build/index.css', __DIR__ ),
[],
$editor_asset['version']
);
}

Expand Down
Loading
Loading