Skip to content
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

fix(utils): fixed the issue that the release version of the utils package could not correspond #2837

Merged
merged 1 commit into from
Jan 22, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
2 changes: 1 addition & 1 deletion packages/renderless/scripts/postbuild.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { promises as fs } from 'node:fs'
async function run() {
const content = await fs.readFile(resolve('package.json'), 'utf8')
const packageJson = JSON.parse(content)
packageJson.dependencies['@opentiny/utils'] = '^1.0.0'
packageJson.dependencies['@opentiny/utils'] = `~${packageJson.version.split('.').slice(0, 2).join('.')}.0`

Choose a reason for hiding this comment

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

The change in dependency versioning from a fixed ^1.0.0 to a dynamic version based on the current package version ensures that the utils package version aligns with the minor version of the current package. This is a critical fix to ensure compatibility and prevent potential version mismatches.

delete packageJson.exports
delete packageJson.private
await fs.writeFile(resolve('dist', 'package.json'), JSON.stringify(packageJson, null, 2))
Expand Down
2 changes: 1 addition & 1 deletion packages/utils/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@opentiny/utils",
"type": "module",
"version": "1.0.0",
"version": "3.21.0",
"description": "nanoid console xss",
"author": "",
"license": "ISC",
Expand Down
Loading