feat/implement asset build - #88
Open
YvetteNikolov wants to merge 10 commits into
Open
YvetteNikolov wants to merge 10 commits into
YvetteNikolov wants to merge 10 commits into
Conversation
YvetteNikolov
requested review from
Rovasch,
ShunLuk,
SimonvanWijhe,
dtakken,
ictbeheer,
mvdhoek1 and
rivanuff
September 9, 2026 13:54
Composer package changes
|
There was a problem hiding this comment.
🟡 Changes recommended
It includes invalid/incorrect tooling configuration (notably package.json and VS Code language-scoped settings) and inconsistent built CSS output that won’t match the component markup.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Pull request overview
This PR adds an asset build pipeline (pnpm + @wordpress/scripts + custom webpack config) to the package skeleton, including an example Blade component, admin assets, and a dynamic Gutenberg block scaffold, while removing the previous “Example” service/test scaffolding.
Changes:
- Introduces webpack/pnpm/TS tooling and adds compiled assets under
public/. - Adds asset-related PHP services/providers plus an example Blade component and dynamic block renderer/views.
- Updates
configure.phpto optionally include/remove all asset-build tooling and related files.
File summaries
| File | Description |
|---|---|
| webpack.config.js | Adds custom webpack config to build scripts/styles/blocks into public/. |
| tsconfig.json | Adds TS config for assets build output. |
| tests/ExampleTest.php | Removes old Example service tests. |
| tests/Console/ExampleCommandTest.php | Removes old example command test. |
| tests/Components/ExampleComponentTest.php | Adds Blade component render test (with mocked asset service). |
| src/SkeletonPackageServiceProvider.php | Registers view components, commands, and asset-related providers. |
| src/Package.php | Adds package name constant used by installer helpers. |
| src/Example.php | Removes old Example service. |
| src/Console/ExampleCommand.php | Simplifies example command output. |
| src/Components/ExampleComponent.php | Adds example Blade component that enqueues an asset. |
| src/BlockServiceProvider.php | Registers block metadata collection and dynamic render callback; remaps block asset URLs. |
| src/Blocks/ExampleBlock.php | Adds dynamic block renderer returning a Blade view. |
| src/AssetService.php | Adds helper to enqueue JS/CSS assets based on .asset.php metadata. |
| src/AdminServiceProvider.php | Enqueues admin assets on admin_enqueue_scripts. |
| resources/views/example.blade.php | Removes old example view. |
| resources/views/components/example-component.blade.php | Adds Blade view for example component. |
| resources/views/blocks/example-block.blade.php | Adds Blade view for dynamic block render output. |
| resources/styles/example-component.css | Adds example component CSS source. |
| resources/styles/admin.css | Adds admin CSS source. |
| resources/scripts/example-component.ts | Adds example component entrypoint importing CSS. |
| resources/scripts/admin.ts | Adds admin entrypoint importing CSS. |
| resources/blocks/example-dynamic/view.js | Adds block view script source. |
| resources/blocks/example-dynamic/style.scss | Adds block frontend style source. |
| resources/blocks/example-dynamic/index.js | Adds block editor script source. |
| resources/blocks/example-dynamic/icon.jsx | Adds block icon source. |
| resources/blocks/example-dynamic/editor.scss | Adds block editor style source. |
| resources/blocks/example-dynamic/edit.js | Adds block edit component source. |
| resources/blocks/example-dynamic/block.json | Adds block metadata definition. |
| README.md | Documents the optional asset build behavior in configure.php. |
| public/example-dynamic/view.js | Adds compiled block view script. |
| public/example-dynamic/view.asset.php | Adds compiled block view asset metadata. |
| public/example-dynamic/style-index.css | Adds compiled block frontend CSS. |
| public/example-dynamic/style-index-rtl.css | Adds compiled block frontend RTL CSS. |
| public/example-dynamic/index.js | Adds compiled block editor JS. |
| public/example-dynamic/index.css | Adds compiled block editor CSS. |
| public/example-dynamic/index.asset.php | Adds compiled block editor asset metadata. |
| public/example-dynamic/index-rtl.css | Adds compiled block editor RTL CSS. |
| public/example-dynamic/block.json | Adds copied/compiled block metadata in build output. |
| public/example-component.js | Adds compiled example component JS. |
| public/example-component.css | Adds compiled example component CSS. |
| public/example-component.asset.php | Adds compiled example component asset metadata. |
| public/example-component-rtl.css | Adds compiled example component RTL CSS. |
| public/blocks-manifest.php | Adds generated blocks manifest for metadata collection registration. |
| public/admin.js | Adds compiled admin JS. |
| public/admin.css | Adds compiled admin CSS. |
| public/admin.asset.php | Adds compiled admin asset metadata. |
| public/admin-rtl.css | Adds compiled admin RTL CSS. |
| pnpm-workspace.yaml | Adds pnpm workspace constraints for dependency freshness. |
| package.json | Adds npm tooling config for asset build/lint/format (currently contains issues). |
| eslint.config.cjs | Adds ESLint config entrypoint. |
| configure.php | Adds optional inclusion/removal of asset build tooling and related sources. |
| composer.lock | Adds yard/wp-package-installer dependency lock changes. |
| composer.json | Switches package type to wordpress-package and enables installer plugin/repo. |
| .vscode/settings.json | Adds editor settings for formatting/linting (currently contains invalid language keys). |
| .stylelintrc.cjs | Adds Stylelint config entrypoint. |
| .prettierrc.cjs | Adds Prettier config entrypoint. |
| .gitignore | Ignores node_modules/. |
Review details
Files not reviewed (1)
- public/example-dynamic/index.js: Generated file
- Files reviewed: 53/59 changed files
- Comments generated: 6
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Comment on lines
+5
to
+8
| "[scss][css][postcss]": { | ||
| "editor.defaultFormatter": "esbenp.prettier-vscode", | ||
| "editor.codeActionsOnSave": { "source.fixAll.prettier": "explicit", "source.fixAll.stylelint": "explicit" } | ||
| }, |
Comment on lines
+9
to
+13
| "[javascript][typescript]": { | ||
| "editor.defaultFormatter": "esbenp.prettier-vscode", | ||
| "editor.codeActionsOnSave": { "source.fixAll.prettier": "explicit", "source.fixAll.eslint": "explicit" }, | ||
| "editor.formatOnPaste": false | ||
| }, |
| @@ -0,0 +1 @@ | |||
| .skeleton-example-component{border:1px solid #000} | |||
| @@ -0,0 +1 @@ | |||
| .skeleton-example-component{border:1px solid #000} | |||
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Wordt nog toegelicht