-
Notifications
You must be signed in to change notification settings - Fork 7
chore: fix generator script for dev versions #167
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
base: main
Are you sure you want to change the base?
chore: fix generator script for dev versions #167
Conversation
🟢 Coverage increased by 35.52% Code Coverage ReportCoverage Report
Files Coverage
|
pnpm exec changeset to create a changeset. |
VERSION="${_temp_part//-/.}-dev" | ||
elif [[ $VERSION == *-dev* ]]; then | ||
_temp_part=${VERSION#*-dev} | ||
_temp_part=${_temp_part//-/.} |
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.
For stability to be recognized as dev
, the version needs to follow the SemVer spec like X.Y.Z-dev+M
. You can use this regex and the snippet below to test this.
<?php
use Composer\Semver\VersionParser;
include "../vendor/autoload.php";
var_dump(VersionParser::parseStability("6.5.0-dev.0")); // "stable"
var_dump(VersionParser::parseStability("6.5.0-dev+0")); // "dev"
I also suggest using -alpha
, -beta
, or -rc
, since -dev
and dev-
have special meanings in Composer. Then we can use 6.5.0-rc
and 6.5.0-rc.1
VERSION="dev-$SANITIZED_VERSION-$BUILD_VERSION" | ||
VERSION=${VERSION//develop/dev} | ||
|
||
if [[ $VERSION =~ ^dev[.-]([0-9]+)[.-]([0-9]+)[.-]([0-9]+)[.-]([0-9]+)$ ]]; then |
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.
Please add comments with the examples for each case so as not to spend time on this next time when we need to edit.
No description provided.