Skip to content

Commit e03a49f

Browse files
committed
Chore: Update ver
1 parent 8583e70 commit e03a49f

File tree

3 files changed

+30
-28
lines changed

3 files changed

+30
-28
lines changed

RELEASE-NOTES.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ This is a pre-release version and APIs will change quickly. Before `1.0` release
44

55
Please note after `1.0` Semver will be followed using normal protocols.
66

7-
# Version 0.10.4-7
7+
# Version 0.10.4-8
88

99
## New
1010
* Add `cdn` links to package.json for jsdelivr and unpkg

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@semantic-ui/core",
3-
"version": "0.10.7",
3+
"version": "0.10.8",
44
"title": "Semantic UI Next",
55
"description": "Semantic empowers designers and developers by creating a shared vocabulary for UI.",
66
"homepage": "http://next.semantic-ui.com",

scripts/update-versions.js

Lines changed: 28 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,11 @@ const execAsync = promisify(exec);
1010

1111
// Helper function to load JSON
1212
const loadJsonFile = (filePath) => {
13-
return JSON.parse(readFileSync(filePath, { encoding: 'utf8' }));
13+
const file = readFileSync(filePath, { encoding: 'utf8' });
14+
return (file) ? JSON.parse(file) : {};
1415
};
1516

17+
1618
// Get the current version from npm
1719
const getCurrentVersionFromNpm = async (packageName) => {
1820
try {
@@ -24,6 +26,29 @@ const getCurrentVersionFromNpm = async (packageName) => {
2426
process.exit(1);
2527
}
2628
};
29+
// Load the main package.json to determine the version to set
30+
const mainPackageJsonPath = join(process.cwd(), 'package.json');
31+
const mainPackageJson = loadJsonFile(mainPackageJsonPath);
32+
const versionArg = process.argv[2];
33+
const dryRun = process.argv.includes('--dry-run');
34+
const ciOverride = process.argv.includes('--ci');
35+
36+
let npmVersion = await getCurrentVersionFromNpm(mainPackageJson.name);
37+
let newVersion = mainPackageJson.version;
38+
39+
const updatedFiles = [];
40+
41+
42+
// Update the version in the main package.json if a new version is set
43+
mainPackageJson.version = newVersion;
44+
updateDependencyVersions(mainPackageJson, newVersion); // Update dependency versions
45+
if (!dryRun) {
46+
writeFileSync(mainPackageJsonPath, JSON.stringify(mainPackageJson, null, 2) + '\n');
47+
}
48+
console.log(`Updated main package version to ${newVersion}`);
49+
updatedFiles.push(mainPackageJsonPath);
50+
51+
2752

2853
// determine if this dependency should have its version number updated
2954
const isUpdateableDep = function(dep) {
@@ -32,7 +57,7 @@ const isUpdateableDep = function(dep) {
3257
return false;
3358
}
3459
return dep.startsWith('@semantic-ui/');
35-
}
60+
};
3661

3762
// Function to update dependency versions in package.json
3863
function updateDependencyVersions(packageJson, newVersion) {
@@ -43,7 +68,7 @@ function updateDependencyVersions(packageJson, newVersion) {
4368
const depVersion = `^${newVersion}`;
4469
if (isUpdateableDep(dep) && packageJson[depType][dep] !== depVersion) { // Simple scope check
4570
packageJson[depType][dep] = depVersion;
46-
console.log(`Updated ${dep} in ${packageJson.name} to ${depVersion}`)
71+
console.log(`Updated ${dep} in ${packageJson.name} to ${depVersion}`);
4772
}
4873
});
4974
}
@@ -107,29 +132,6 @@ async function updatePackageVersion(dir) {
107132
}
108133
}
109134

110-
// Load the main package.json to determine the version to set
111-
const mainPackageJsonPath = join(process.cwd(), 'package.json');
112-
const mainPackageJson = loadJsonFile(mainPackageJsonPath);
113-
const versionArg = process.argv[2];
114-
const dryRun = process.argv.includes('--dry-run');
115-
const ciOverride = process.argv.includes('--ci');
116-
117-
let npmVersion = await getCurrentVersionFromNpm(mainPackageJson.name);
118-
let newVersion = mainPackageJson.version;
119-
120-
const updatedFiles = [];
121-
122-
// Update the version in the main package.json if a new version is set
123-
mainPackageJson.version = newVersion;
124-
updateDependencyVersions(mainPackageJson, newVersion); // Update dependency versions
125-
if (!dryRun) {
126-
writeFileSync(mainPackageJsonPath, JSON.stringify(mainPackageJson, null, 2) + '\n');
127-
}
128-
console.log(`Updated main package version to ${newVersion}`);
129-
updatedFiles.push(mainPackageJsonPath);
130-
131-
132-
133135
// Read workspaces to publish from main package
134136
// ignoring internal packages
135137
const workspaceGlobs = mainPackageJson.workspaces.filter(val => !val.includes('internal-packages'));

0 commit comments

Comments
 (0)