Skip to content

Commit

Permalink
release/v1.5.0 (#92)
Browse files Browse the repository at this point in the history
Co-authored-by: [email protected] <[email protected]>
Co-authored-by: JustinErenJaeger <[email protected]>
  • Loading branch information
3 people authored Aug 30, 2022
1 parent 62047ea commit 2651589
Show file tree
Hide file tree
Showing 104 changed files with 18,182 additions and 12,342 deletions.
1 change: 1 addition & 0 deletions .github/workflows/ci-test-happner-cluster.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ jobs:

- run: npm run lint --package_name=happner-cluster
- run: npm run-script test-cover --workspace=happner-cluster
- run: npm run-script test-browser --workspace=happner-cluster

- name: Generate coverage branch
uses: team-tenacious/monorepo-coverage@main
Expand Down
4 changes: 2 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ packages/happn-3/test/browser/browser-client-02.js
!packages/happn-db-provider-mongo/test/__fixtures/data/*.nedb

packages/happner-cluster/test/stress/logs/*.log
packages/happner-client/test/example.com.cert
packages/happner-client/test/example.com.key

temp/*

node_modules-no-leak
11 changes: 11 additions & 0 deletions RELEASES.md
Original file line number Diff line number Diff line change
Expand Up @@ -89,3 +89,14 @@ happner-client: 12.2.8
redis-lru-cache: 1.0.12
happner-cluster: 12.1.9
happn-cluster: 12.0.12

1.5.0 2022-08-07
----------------
- TEN-31: on behalf of
happn-3: 13.2.0
happner-2: 12.2.0
happner-client: 12.3.0
happner-cluster: 12.2.0
happn-cluster: 12.0.13
happn-db-provider-elasticsearch: 1.0.13
happn-db-provider-mongo: 1.0.13
50 changes: 48 additions & 2 deletions bin/pre-publish.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,11 @@ Promise.all(
console.log('fetched data from npm');
packagesMetaData = metaData.map((metaDataItem) => {
let localPackage = workspacePackages.find((item) => item.name === metaDataItem.data.name);
if (!localPackage) return null;
console.log('scanning package: ', metaDataItem.data.name);
const newVersion = localPackage.version;
const lastVersion = metaDataItem.data['dist-tags'].latest;
const lastVersion = getLatestNonPrereleaseVersion(metaDataItem.data['versions']);
console.log(`highest current version:${lastVersion}, local version: ${newVersion}`);
const isPrerelease = newVersion.match(/^([0-9]\d*)\.([0-9]\d*)\.([0-9]\d*)$/) == null;
return {
publishOrder: getPackagePublishOrder(localPackage.name),
Expand All @@ -48,7 +51,7 @@ Promise.all(
releasesUpToDate: checkReleasesUpToDate(localPackage),
possibleOnlyInTests: checkOnlyInTests(localPackage),
};
});
}).filter((item) => item !== null);
console.log('fetching master package...');
return require('axios').default.get(
`https://raw.githubusercontent.com/happner/happner-suite/master/package.json`
Expand All @@ -62,6 +65,49 @@ Promise.all(
throw e;
});

function getVersionObject(versionString) {
const split = versionString.split('.');
const versionObject= {
versionString,
major: parseInt(split[0]),
minor: parseInt(split[1]),
patch: isNaN(split[2]) ? split[2] : parseInt(split[2]),
};
versionObject.isPrerelease = isNaN(versionObject.patch);
return versionObject;
}

function getLatestNonPrereleaseVersion(versions) {
const nonPrereleaseVersions = Object.keys(versions)
.map(versionString => getVersionObject(versionString))
.filter(versionObject => {
return versionObject.isPrerelease === false;
});

nonPrereleaseVersions.sort((versionObjectA, versionObjectB) => {
if (versionObjectA.major > versionObjectB.major) {
return 1;
}
if (versionObjectB.major > versionObjectA.major) {
return -1;
}
if (versionObjectA.minor > versionObjectB.minor) {
return 1;
}
if (versionObjectB.minor > versionObjectA.minor) {
return -1;
}
if (versionObjectA.patch > versionObjectB.patch) {
return 1;
}
if (versionObjectB.patch > versionObjectA.patch) {
return -1;
}
return 0;
});
return nonPrereleaseVersions.pop().versionString;
}

function verifyPublish(packagesMetaData, masterPackage) {
let issues = [],
successes = [];
Expand Down
Loading

0 comments on commit 2651589

Please sign in to comment.