Skip to content

feat: add @yardinternet/wp-scripts-config - #143

Merged
YvetteNikolov merged 1 commit into
mainfrom
feat/wp-scripts-config
Aug 10, 2026
Merged

feat: add @yardinternet/wp-scripts-config#143
YvetteNikolov merged 1 commit into
mainfrom
feat/wp-scripts-config

Conversation

@YvetteNikolov

Copy link
Copy Markdown
Contributor

No description provided.

Copilot AI lite review requested due to automatic review settings August 10, 2026 14:19
@YvetteNikolov
YvetteNikolov requested a review from a team as a code owner August 10, 2026 14:19
@YvetteNikolov
YvetteNikolov force-pushed the feat/wp-scripts-config branch from 9d3a016 to d87aa53 Compare August 10, 2026 14:21
@YvetteNikolov
YvetteNikolov merged commit 82f6806 into main Aug 10, 2026
2 checks passed
@YvetteNikolov
YvetteNikolov deleted the feat/wp-scripts-config branch August 10, 2026 14:23

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a new @yardinternet/wp-scripts-config package to the monorepo, intended to wrap @wordpress/scripts’ webpack config and apply Yard-specific fixes (currently disabling Sass’ BOM-emitting charset behavior). The root Vitest workspace is updated to include this new package’s test suite.

Changes:

  • Add new packages/wp-scripts-config package exporting a transformed @wordpress/scripts webpack config.
  • Add a disable-sass-charset transform plus a Vitest suite validating schema compatibility and Sass BOM behavior.
  • Register the new package’s Vitest project in the root vitest.config.mjs.

Reviewed changes

Copilot reviewed 8 out of 9 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
vitest.config.mjs Adds the new package’s Vitest project to the workspace test run.
packages/wp-scripts-config/vitest.config.mjs Defines the package-local Vitest configuration.
packages/wp-scripts-config/tests/index.test.js Adds tests for schema validity, sass-loader option merging, and BOM suppression behavior.
packages/wp-scripts-config/src/transforms/disable-sass-charset.js Implements the transform that sets sassOptions.charset = false for sass-loader rules.
packages/wp-scripts-config/src/index.js Exports the transformed @wordpress/scripts config by applying transforms in sequence.
packages/wp-scripts-config/README.md Documents purpose, usage, and how to add future fixes.
packages/wp-scripts-config/package.json Introduces the new package manifest with peer/dev dependencies.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment on lines +11 to +26
module.exports = ( config ) => {
for ( const rule of config.module?.rules ?? [] ) {
for ( const use of Array.isArray( rule.use ) ? rule.use : [] ) {
if ( ! use?.loader?.includes?.( 'sass-loader' ) ) {
continue;
}

use.options = {
...use.options,
sassOptions: { ...use.options?.sassOptions, charset: false },
};
}
}

return config;
};
const config = require( '../src/index.js' );
const disableSassCharset = require( '../src/transforms/disable-sass-charset' );

const BOM = '';
Comment on lines +5 to +10
// Add all transforms to the array here.
const allTransforms = [ require( './transforms/disable-sass-charset' ) ];

module.exports = allTransforms.reduce(
( config, transform ) => transform( config ),
defaultConfig
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants