-
-
Notifications
You must be signed in to change notification settings - Fork 291
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
Chore update picomatch #2993
Chore update picomatch #2993
Conversation
WalkthroughThis pull request updates multiple package configurations and Webpack settings to support a browser-specific build. The changes add new browser entry points in package.json files, update build scripts to include a clean step and browser build via Webpack, and introduce a new dependency on Webpack. Additionally, new Webpack configuration files are introduced for certain packages using a factory method, and redundant aliasing for the “picomatch” module is removed across several packages. An external dependency is also added to the root Webpack configuration. Changes
Sequence Diagram(s)sequenceDiagram
participant Dev as Developer
participant BuildScript as Build Script (package.json)
participant Clean as Clean Command ("rm -rf lib")
participant Webpack as Webpack (build:browser)
Dev->>BuildScript: Execute "build" script
BuildScript->>Clean: Run "clean" script
Clean-->>BuildScript: Lib directory removed
BuildScript->>BuildScript: Run "barrels" & "build:ts"
BuildScript->>Webpack: Run "build:browser" script
Webpack-->>BuildScript: Generate browser-specific bundle
✨ Finishing Touches
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
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.
Actionable comments posted: 5
📜 Review details
Configuration used: CodeRabbit UI
Review profile: ASSERTIVE
Plan: Pro
⛔ Files ignored due to path filters (1)
yarn.lock
is excluded by!**/yarn.lock
,!**/*.lock
📒 Files selected for processing (9)
packages/specs/ajv/package.json
(2 hunks)packages/specs/ajv/webpack.config.cjs
(1 hunks)packages/specs/exceptions/package.json
(2 hunks)packages/specs/exceptions/webpack.config.cjs
(1 hunks)packages/specs/json-mapper/webpack.config.cjs
(0 hunks)packages/specs/schema/package.json
(2 hunks)packages/specs/schema/webpack.config.cjs
(0 hunks)packages/third-parties/schema-formio/webpack.config.cjs
(0 hunks)tools/webpack/webpack.config.js
(1 hunks)
💤 Files with no reviewable changes (3)
- packages/specs/schema/webpack.config.cjs
- packages/third-parties/schema-formio/webpack.config.cjs
- packages/specs/json-mapper/webpack.config.cjs
🧰 Additional context used
🪛 ESLint
packages/specs/ajv/webpack.config.cjs
[error] 3-3: Delete ,
(prettier/prettier)
packages/specs/exceptions/webpack.config.cjs
[error] 3-3: Delete ,
(prettier/prettier)
🔇 Additional comments (11)
packages/specs/ajv/package.json (5)
10-10
: Added Browser Field (Top-level)
Adding the"browser": "./lib/browser/ajv.umd.min.js"
field at the top-level explicitly directs bundlers to use the UMD build for browser environments. Ensure that the referenced file exists in the build output.
15-15
: Exports Update for Browser Support
The addition of the"browser": "./lib/browser/ajv.umd.min.js"
entry inside the"exports"
block reinforces module resolution for browsers. This aligns well with modern bundler expectations.
22-22
: Enhanced Build Script with Integrated Clean and Browser Build Steps
Modifying the"build"
script to execute"yarn clean && yarn barrels && yarn build:ts && yarn run build:browser"
promotes a more reliable build process by ensuring a clean slate and incorporating browser-specific builds. Confirm that all these sub-commands are correctly set up in your CI/CD pipeline.
23-23
: Dedicated Browser Build Command
Introducing the"build:browser": "webpack"
script cleanly separates the browser build process. Please verify that the necessary Webpack configuration is in place and referenced correctly so that the output file (ajv.umd.min.js
) is generated as expected.
44-45
: Webpack Dependency Addition and Vitest Update
Adding"webpack": "^5.75.0"
todevDependencies
is essential for running the new browser build script, and updating"vitest": "2.1.2"
ensures consistency across development tooling. It is advisable to double-check compatibility with other parts of the build process and any related configuration across the repository.packages/specs/ajv/webpack.config.cjs (1)
1-4
: Overall Configuration Setup Looks Correct
The configuration correctly utilizes thecreate
method from the@tsed/webpack-config
package, specifying the current directory as the root and naming the configuration "ajv". This should effectively establish the intended build parameters.🧰 Tools
🪛 ESLint
[error] 3-3: Delete
,
(prettier/prettier)
packages/specs/schema/package.json (1)
56-56
: Minor Update for@types/picomatch
The type definitions forpicomatch
have been updated from 3.0.1 to 3.0.2. This update should ensure better alignment with the new functionality of the updatedpicomatch
package. It is recommended to run a full type-check to catch any potential discrepancy if advanced type features are in use.packages/specs/exceptions/webpack.config.cjs (1)
1-4
: Overall configuration structure is correct.
The webpack configuration correctly uses the@tsed/webpack-config
factory to create a configuration object with the properroot
andname
properties.🧰 Tools
🪛 ESLint
[error] 3-3: Delete
,
(prettier/prettier)
packages/specs/exceptions/package.json (2)
10-15
: Addition of browser-specific fields.
A new"browser"
field is introduced at the top level and within the"exports"
section to support browser-specific module resolution. Verify that the path ("./lib/browser/exceptions.umd.min.js"
) is correctly produced during the build process.
40-41
: Updated devDependencies for build tools.
Adding"webpack": "^5.75.0"
(together with the existing"vitest": "2.1.2"
) ensures that the build process can generate the browser bundle. Confirm that these versions are fully compatible with your overall project configuration.tools/webpack/webpack.config.js (1)
31-31
:❓ Verification inconclusive
LGTM! Verify browser build compatibility.
The addition of
@tsed/exceptions
as an external dependency follows the established pattern and is consistent with other@tsed
packages.Let's verify that the package is properly configured for browser usage:
🏁 Script executed:
#!/bin/bash # Description: Verify browser build configuration for @tsed/exceptions # Check if @tsed/exceptions package.json has browser field echo "Checking browser field in package.json..." fd -t f "package.json" | xargs rg -l "@tsed/exceptions" | xargs rg "browser" # Check if UMD build exists echo "Checking for UMD build..." fd -t f "@tsed/exceptions.*.umd.*.js$"Length of output: 989
LGTM – External Dependency Configuration Verified
The addition of@tsed/exceptions
to the externals in the webpack configuration is consistent with the existing pattern for other@tsed
packages. Our verification shows that the package’spackage.json
(inpackages/specs/exceptions
) includes the expected browser field pointing to./lib/browser/exceptions.umd.min.js
. Note that the initial search for a UMD build file did not yield results; this is likely due to such files being generated during the build process rather than being present in the repository. Please ensure that the build pipeline generates and bundles the UMD file as expected for browser compatibility.
"import": "./lib/esm/index.js", | ||
"default": "./lib/esm/index.js" | ||
} | ||
}, | ||
"scripts": { | ||
"build": "yarn barrels && yarn build:ts", | ||
"clean": "rm -rf lib", |
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.
🧹 Nitpick (assertive)
Clean Script Addition
The "clean": "rm -rf lib"
script ensures that the output directory is purged before initiating new builds. If cross-platform compatibility (e.g., Windows systems) is a concern, consider using a tool like rimraf
.
@@ -0,0 +1,4 @@ | |||
module.exports = require("@tsed/webpack-config").create({ | |||
root: __dirname, | |||
name: "ajv", |
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.
🧹 Nitpick (assertive)
Remove Trailing Comma per ESLint/Prettier Guidelines
ESLint is flagging a trailing comma on line 3. Removing the trailing comma after the "ajv"
value will align the code with prettier formatting rules.
Apply the following diff:
- name: "ajv",
+ name: "ajv"
📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
name: "ajv", | |
name: "ajv" |
🧰 Tools
🪛 ESLint
[error] 3-3: Delete ,
(prettier/prettier)
@@ -40,7 +40,7 @@ | |||
"@tsed/openspec": "workspace:*", | |||
"change-case": "^5.4.4", | |||
"json-schema": "0.4.0", | |||
"picomatch": "2.3.1", | |||
"picomatch": "4.0.2", |
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.
🧹 Nitpick (assertive)
Major Version Update for picomatch
Dependency
The version for picomatch
has been updated from its previous version (assumed to be 2.3.1) to 4.0.2. This represents a major version bump and could potentially introduce breaking changes. Please review the picomatch changelog and verify that all usages in the codebase are compatible with any updated API behavior.
@@ -0,0 +1,4 @@ | |||
module.exports = require("@tsed/webpack-config").create({ | |||
root: __dirname, | |||
name: "exceptions", |
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.
🧹 Nitpick (assertive)
Remove unnecessary trailing comma.
ESLint (prettier) flagged an extraneous comma after the "exceptions"
value. If your linting rules require its removal, please update as follows:
- name: "exceptions",
+ name: "exceptions"
📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
name: "exceptions", | |
name: "exceptions" |
🧰 Tools
🪛 ESLint
[error] 3-3: Delete ,
(prettier/prettier)
"clean": "rm -rf lib", | ||
"build": "yarn clean && yarn barrels && yarn build:ts && yarn run build:browser", | ||
"build:browser": "webpack", |
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.
🧹 Nitpick (assertive)
Enhanced build scripts with browser build support.
The changes introduce a new "clean"
script to remove the lib
directory, update the "build"
script to perform a clean step before building, and add a "build:browser"
script that runs webpack. As these scripts now rely on Unix-like shell commands (e.g., rm -rf lib
), consider using a cross-platform solution (such as the rimraf
package) if Windows compatibility is a concern.
🎉 This PR is included in version 8.5.0 🎉 The release is available on:
Your semantic-release bot 📦🚀 |
Summary by CodeRabbit
New Features
Refactor
Chores