From c02ecdcac00360a4db1228ab7677145424273eeb Mon Sep 17 00:00:00 2001 From: Eren Yeager Date: Fri, 25 Jul 2025 12:10:41 +0000 Subject: [PATCH 1/8] chore: refactor changelog script and make it an standalone script --- package.json | 8 +- scripts/changelog/command.mjs | 74 ++++++++++++++++ scripts/common/changelog.mjs | 121 ++++++++++++++++++-------- scripts/common/errors.mjs | 10 +-- scripts/common/github.mjs | 8 +- scripts/publish/publish.mjs | 9 +- yarn.lock | 156 +++++++++++++++++++++++++--------- 7 files changed, 291 insertions(+), 95 deletions(-) create mode 100644 scripts/changelog/command.mjs diff --git a/package.json b/package.json index 9a28d3378a..390462edfe 100644 --- a/package.json +++ b/package.json @@ -65,6 +65,7 @@ "@babel/core": "^7.22.5", "@commitlint/cli": "^18.6.1", "@commitlint/config-conventional": "^18.6.2", + "@conventional-changelog/git-client": "^2.5.1", "@eslint/compat": "^1.2.5", "@eslint/eslintrc": "^3.2.0", "@eslint/js": "^9.19.0", @@ -81,10 +82,11 @@ "buffer": "^5.5.0", "chalk": "^5.2.0", "command-line-args": "^5.2.1", - "conventional-changelog-angular": "^5.0.13", + "conventional-changelog": "^7.1.0", + "conventional-changelog-angular": "^8.0.0", "conventional-changelog-cli": "^2.2.2", - "conventional-commits-filter": "^2.0.7", - "conventional-commits-parser": "^3.2.4", + "conventional-commits-filter": "^5.0.0", + "conventional-commits-parser": "^6.2.0", "conventional-recommended-bump": "^6.1.0", "crypto-browserify": "^3.12.0", "esbuild": "^0.20.1", diff --git a/scripts/changelog/command.mjs b/scripts/changelog/command.mjs new file mode 100644 index 0000000000..de6fc27a35 --- /dev/null +++ b/scripts/changelog/command.mjs @@ -0,0 +1,74 @@ +#!/usr/bin/env node +'use strict'; + +import { discoverWorkspacePackages } from '../common/repository.mjs'; +import commandLineArgs from 'command-line-args'; +import { + generateChangelog, + getInfoBeforeGeneratingChangelog, + changelogFileStream, + generateChangelogAndSave, + generateChangelogAndPrint, +} from '../common/changelog.mjs'; +import { + workspacePackages, + packageNamesToPackagesWithInfo, +} from '../common/utils.mjs'; + +// NOTE: changelog should be run before the tagging proccess for the new release. + +// TODO: Add single repo flow for genrating changelog, the whole assumption here is we are in a monorepo. +async function run() { + const optionDefinitions = [ + { name: 'name', type: String }, + { name: 'save', type: Boolean }, + ]; + const { name, save } = commandLineArgs(optionDefinitions); + + // Create a list of packages we are going to create changelog for. + const packages = []; + if (name) { + const pkgs = await packageNamesToPackagesWithInfo([name]); + if (pkgs.length !== 1) + throw new Error('Your provided package is not found.', { cause: pkgs }); + + packages.push(pkgs[0]); + } else { + console.warn( + "You didn't specify any package name, so we will consider this as all the public packages should be considered." + ); + + const list = await workspacePackages(); + list + .filter((pkg) => !pkg.private) + .forEach((pkg) => { + packages.push(pkg); + }); + } + + // Try generate changelog for each of them. + for (const pkg of packages) { + const { from, commitsCount } = await getInfoBeforeGeneratingChangelog(pkg); + + if (commitsCount > 0) { + console.log('name:', pkg.name); + console.log('from:', from || 'start (first release)'); + console.log('commits:', commitsCount); + + if (save) { + generateChangelogAndSave(pkg); + } else { + generateChangelogAndPrint(pkg); + } + } else { + console.log( + `No commits found for ${pkg.name}, skipping changelog generation.` + ); + } + } +} + +run().catch((e) => { + console.error(e); + process.exit(1); +}); diff --git a/scripts/common/changelog.mjs b/scripts/common/changelog.mjs index 59340e3540..81d1a75dc2 100644 --- a/scripts/common/changelog.mjs +++ b/scripts/common/changelog.mjs @@ -1,49 +1,96 @@ -import { execa } from 'execa'; -import { GenerateChangelogFailedError, YarnError } from './errors.mjs'; import { packageNameWithoutScope } from './utils.mjs'; +import { ConventionalChangelog } from 'conventional-changelog'; +import { ConventionalGitClient } from '@conventional-changelog/git-client'; +import { WriteStream } from 'node:fs'; +import fs from 'node:fs'; +import path from 'node:path'; + +/** + * Retrieving some useful information when you are going to generate a changelog + * + * @param {import("./typedefs.mjs").Package} pkg + */ +export async function getInfoBeforeGeneratingChangelog(pkg) { + const gitClient = new ConventionalGitClient(process.cwd()); + const tagsParams = { + prefix: `${packageNameWithoutScope(pkg.name)}@`, + }; + const semverTagsStream = gitClient.getSemverTags(tagsParams); + const semverTags = []; + for await (const tag of semverTagsStream) { + semverTags.push(tag); + } + + const commitsParams = { + merges: false, + from: semverTags[0], + path: pkg.location, + }; + const commitsStream = gitClient.getCommits(commitsParams); + + const commits = []; + for await (const commit of commitsStream) { + commits.push(commit); + } + + return { + /** Where is considering as starting point, it is genrally a tag. undefined means it's the first release.'*/ + from: semverTags[0], + /** How many commits this release has. */ + commitsCount: commits.length, + }; +} + +/** + * Create a write stream for the target package's changelog. + * + * @param {import("./typedefs.mjs").Package} pkg + * @returns {WriteStream} + */ +export function changelogFileStream(pkg) { + const changelogPath = path.join(pkg.location, 'CHANGELOG.md'); + const file = fs.createWriteStream(changelogPath, { + encoding: 'utf-8', + flags: 'a', + }); + + return file; +} /** * Generate a changelog by using convetional commit format. + * It uses tags to identify releases. * * @param {import("./typedefs.mjs").Package} pkg - * @param {Object} options - * @param {boolean} options.saveToFile `true` for using it for creating `pkg/CHANGELOG.com` and `false` for Github Release note. + * @returns {WriteStream} */ -export async function generateChangelog(pkg, options) { - const { saveToFile = false } = options || {}; - - const conventionalChangelogBinPath = await execa('yarn', [ - 'bin', - 'conventional-changelog', - ]) - .then((result) => result.stdout) - .catch((err) => { - throw new YarnError(`GetBinaryPathFailed: \n${err.stdout}`); - }); +export async function generateChangelog(pkg) { + const generator = new ConventionalChangelog(process.cwd()); + // TODO: idk why without .json at the was working before + generator.readPackage(`${pkg.location}/package.json`); + generator.loadPreset('angular'); + let commitsOptions = { + path: pkg.location, + }; + + // Our tagging is using lerna convention which is package-name@version + // for example for @rango-dev/wallets-core, it will be wallets-core@1.1.0 const tagName = packageNameWithoutScope(pkg.name); - const command = [ - 'conventional-changelog', - '-p', - 'angular', - '-l', - `${tagName}`, - '-k', - pkg.location, - '--commit-path', - pkg.location, - ]; - - if (saveToFile) { - const changelogPath = `${pkg.location}/CHANGELOG.md`; - command.push('-i', changelogPath, '-s'); - } + generator.tags({ + prefix: `${tagName}@`, + }); + generator.commits(commitsOptions); - const result = await execa(conventionalChangelogBinPath, command) - .then((result) => result.stdout) - .catch((err) => { - throw new GenerateChangelogFailedError(err.stdout); - }); + return generator.writeStream(); +} + +export function generateChangelogAndSave(pkg) { + const changelog = generateChangelog(pkg); + changelog.pipe(changelogFileStream(pkg)); +} - return result; +export function generateChangelogAndPrint(pkg) { + const changelog = generateChangelog(pkg); + changelog.pipe(process.stdout); } diff --git a/scripts/common/errors.mjs b/scripts/common/errors.mjs index d0ceabe491..2afcc7e284 100644 --- a/scripts/common/errors.mjs +++ b/scripts/common/errors.mjs @@ -54,13 +54,6 @@ export class IncreaseVersionFailedError extends Error { } } -export class GenerateChangelogFailedError extends Error { - name = 'GenerateChangelogFailedError'; - constructor(msg) { - super(msg); - } -} - export class UnableToProceedPublishError extends Error { name = 'UnableToProceedPublishError'; constructor(msg) { @@ -110,4 +103,5 @@ export class VercelError extends Error { constructor(msg) { super(msg); } -} \ No newline at end of file +} + diff --git a/scripts/common/github.mjs b/scripts/common/github.mjs index cda30902e8..9b68ec5cb3 100644 --- a/scripts/common/github.mjs +++ b/scripts/common/github.mjs @@ -41,9 +41,11 @@ export async function getGithubReleaseFor(pkg) { * @param {import('./typedefs.mjs').Package} pkg */ export async function makeGithubRelease(pkg) { - const notes = await generateChangelog(pkg, { - saveToFile: false, - }); + const notes = ''; + for await (chunk of generateChangelog(pkg)) { + notes += chunk; + } + const tagName = generateTagName(pkg); const output = await execa('gh', [ 'release', diff --git a/scripts/publish/publish.mjs b/scripts/publish/publish.mjs index 6af913ad25..fd3177850d 100644 --- a/scripts/publish/publish.mjs +++ b/scripts/publish/publish.mjs @@ -1,12 +1,9 @@ import chalk from 'chalk'; -import { generateChangelog } from '../common/changelog.mjs'; +import { generateChangelogAndSave } from '../common/changelog.mjs'; import { should } from '../common/features.mjs'; import { publishOnNpm } from '../common/npm.mjs'; import { upgradeDependents } from './upgrade.mjs'; -import { - addPkgFileChangesToStage, - sequentiallyRun, -} from './utils.mjs'; +import { addPkgFileChangesToStage, sequentiallyRun } from './utils.mjs'; /** * @@ -44,7 +41,7 @@ async function publishTask(pkg, { onUpdateState }) { if (should('generateChangelog')) { console.log(chalk.green('[2/4]'), `Making changelog`); - await generateChangelog(pkg, { saveToFile: true }); + generateChangelogAndSave(pkg); } else { console.log(chalk.green('[2/4]'), `Skipping changelog and github release.`); } diff --git a/yarn.lock b/yarn.lock index c7008d2f86..226ffcb02d 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2251,6 +2251,15 @@ "@noble/hashes" "^1.0.0" protobufjs "^6.8.8" +"@conventional-changelog/git-client@^2.5.1": + version "2.5.1" + resolved "https://registry.yarnpkg.com/@conventional-changelog/git-client/-/git-client-2.5.1.tgz#770d3911264653492d18366751e06b14a6ec7b3d" + integrity sha512-lAw7iA5oTPWOLjiweb7DlGEMDEvzqzLLa6aWOly2FSZ64IwLE8T458rC+o+WvI31Doz6joM7X2DoNog7mX8r4A== + dependencies: + "@simple-libs/child-process-utils" "^1.0.0" + "@simple-libs/stream-utils" "^1.1.0" + semver "^7.5.2" + "@cosmjs/amino@0.27.1": version "0.27.1" resolved "https://registry.yarnpkg.com/@cosmjs/amino/-/amino-0.27.1.tgz#0910256b5aecd794420bb5f7319d98fc63252fa1" @@ -6375,6 +6384,21 @@ dependencies: "@sentry/types" "7.119.1" +"@simple-libs/child-process-utils@^1.0.0": + version "1.0.1" + resolved "https://registry.yarnpkg.com/@simple-libs/child-process-utils/-/child-process-utils-1.0.1.tgz#75062207018fff34727364c5a77ee7d4289874ad" + integrity sha512-3nWd8irxvDI6v856wpPCHZ+08iQR0oHTZfzAZmnbsLzf+Sf1odraP6uKOHDZToXq3RPRV/LbqGVlSCogm9cJjg== + dependencies: + "@simple-libs/stream-utils" "^1.1.0" + "@types/node" "^22.0.0" + +"@simple-libs/stream-utils@^1.1.0": + version "1.1.0" + resolved "https://registry.yarnpkg.com/@simple-libs/stream-utils/-/stream-utils-1.1.0.tgz#646d414701d15fdb0636561a744ff978e985dda5" + integrity sha512-6rsHTjodIn/t90lv5snQjRPVtOosM7Vp0AKdrObymq45ojlgVwnpAqdc+0OBBrpEiy31zZ6/TKeIVqV1HwvnuQ== + dependencies: + "@types/node" "^22.0.0" + "@sinclair/typebox@^0.27.8": version "0.27.8" resolved "https://registry.yarnpkg.com/@sinclair/typebox/-/typebox-0.27.8.tgz#6667fac16c436b5434a387a34dedb013198f6e6e" @@ -8751,14 +8775,14 @@ resolved "https://registry.yarnpkg.com/@types/minimist/-/minimist-1.2.5.tgz#ec10755e871497bcd83efe927e43ec46e8c0747e" integrity sha512-hov8bUuiLiyFPGyFPE1lwWhmzYbirOXQNNo40+y3zow8aFVTeyn3VWL0VFFfdNddA8S4Vf0Tc062rzyNr7Paag== -"@types/node@*", "@types/node@10.12.18", "@types/node@18.15.13", "@types/node@>=13.7.0", "@types/node@^12.12.54", "@types/node@^18.0.0", "@types/node@^20.17.19": +"@types/node@*", "@types/node@10.12.18", "@types/node@18.15.13", "@types/node@>=13.7.0", "@types/node@^12.12.54", "@types/node@^18.0.0", "@types/node@^20.17.19", "@types/node@^22.0.0": version "20.17.19" resolved "https://registry.yarnpkg.com/@types/node/-/node-20.17.19.tgz#0f2869555719bef266ca6e1827fcdca903c1a697" integrity sha512-LEwC7o1ifqg/6r2gn9Dns0f1rhK+fPFDoMiceTJ6kWmVk6bgXBI/9IOWfVan4WiAavK9pIVWdX0/e3J+eEUh5A== dependencies: undici-types "~6.19.2" -"@types/normalize-package-data@^2.4.0": +"@types/normalize-package-data@^2.4.0", "@types/normalize-package-data@^2.4.4": version "2.4.4" resolved "https://registry.yarnpkg.com/@types/normalize-package-data/-/normalize-package-data-2.4.4.tgz#56e2cc26c397c038fab0e3a917a12d5c5909e901" integrity sha512-37i+OaWTh9qeK4LSHPsyRC7NahnGotNuZvjLSgcPzblpHB3rrCJxAOgI5gCdKm7coonsaX1Of0ILiTcnZjbfxA== @@ -11478,7 +11502,7 @@ content-type@~1.0.4, content-type@~1.0.5: resolved "https://registry.yarnpkg.com/content-type/-/content-type-1.0.5.tgz#8b773162656d1d1086784c8f23a54ce6d73d7918" integrity sha512-nTjqfcBFEipKdXCv4YDQWCfmcLZKm81ldF0pAopTvyrFGVbcR6P/VAAd5G7N+0tTr8QqiU0tFadD6FK4NtJwOA== -conventional-changelog-angular@^5.0.12, conventional-changelog-angular@^5.0.13: +conventional-changelog-angular@^5.0.12: version "5.0.13" resolved "https://registry.yarnpkg.com/conventional-changelog-angular/-/conventional-changelog-angular-5.0.13.tgz#896885d63b914a70d4934b59d2fe7bde1832b28c" integrity sha512-i/gipMxs7s8L/QeuavPF2hLnJgH6pEZAttySB6aiQLWcX3puWDL3ACVmvBhJGxnAy52Qc15ua26BufY6KpmrVA== @@ -11493,6 +11517,13 @@ conventional-changelog-angular@^7.0.0: dependencies: compare-func "^2.0.0" +conventional-changelog-angular@^8.0.0: + version "8.0.0" + resolved "https://registry.yarnpkg.com/conventional-changelog-angular/-/conventional-changelog-angular-8.0.0.tgz#5701386850f0e0c2e630b43ee7821d322d87e7a6" + integrity sha512-CLf+zr6St0wIxos4bmaKHRXWAcsCXrJU6F4VdNDrGRK3B8LDLKoX3zuMV5GhtbGkVR/LohZ6MT6im43vZLSjmA== + dependencies: + compare-func "^2.0.0" + conventional-changelog-atom@^2.0.8: version "2.0.8" resolved "https://registry.yarnpkg.com/conventional-changelog-atom/-/conventional-changelog-atom-2.0.8.tgz#a759ec61c22d1c1196925fca88fe3ae89fd7d8de" @@ -11595,6 +11626,11 @@ conventional-changelog-preset-loader@^2.3.4: resolved "https://registry.yarnpkg.com/conventional-changelog-preset-loader/-/conventional-changelog-preset-loader-2.3.4.tgz#14a855abbffd59027fd602581f1f34d9862ea44c" integrity sha512-GEKRWkrSAZeTq5+YjUZOYxdHq+ci4dNwHvpaBC3+ENalzFWuCWa9EZXSuZBpkr72sMdKB+1fyDV4takK1Lf58g== +conventional-changelog-preset-loader@^5.0.0: + version "5.0.0" + resolved "https://registry.yarnpkg.com/conventional-changelog-preset-loader/-/conventional-changelog-preset-loader-5.0.0.tgz#922ad617c13ad3243bef967cfc0f8373893c216d" + integrity sha512-SetDSntXLk8Jh1NOAl1Gu5uLiCNSYenB5tm0YVeZKePRIgDW9lQImromTwLa3c/Gae298tsgOM+/CYT9XAl0NA== + conventional-changelog-writer@^5.0.0: version "5.0.1" resolved "https://registry.yarnpkg.com/conventional-changelog-writer/-/conventional-changelog-writer-5.0.1.tgz#e0757072f045fe03d91da6343c843029e702f359" @@ -11610,6 +11646,16 @@ conventional-changelog-writer@^5.0.0: split "^1.0.0" through2 "^4.0.0" +conventional-changelog-writer@^8.1.0: + version "8.2.0" + resolved "https://registry.yarnpkg.com/conventional-changelog-writer/-/conventional-changelog-writer-8.2.0.tgz#1b77ef8e45ccc4559e02a23a34d50c15d2051e5a" + integrity sha512-Y2aW4596l9AEvFJRwFGJGiQjt2sBYTjPD18DdvxX9Vpz0Z7HQ+g1Z+6iYDAm1vR3QOJrDBkRHixHK/+FhkR6Pw== + dependencies: + conventional-commits-filter "^5.0.0" + handlebars "^4.7.7" + meow "^13.0.0" + semver "^7.5.2" + conventional-changelog@^3.1.24: version "3.1.25" resolved "https://registry.yarnpkg.com/conventional-changelog/-/conventional-changelog-3.1.25.tgz#3e227a37d15684f5aa1fb52222a6e9e2536ccaff" @@ -11627,6 +11673,20 @@ conventional-changelog@^3.1.24: conventional-changelog-jshint "^2.0.9" conventional-changelog-preset-loader "^2.3.4" +conventional-changelog@^7.1.0: + version "7.1.0" + resolved "https://registry.yarnpkg.com/conventional-changelog/-/conventional-changelog-7.1.0.tgz#3b2c0fd34f62b754b140f00bdb76fb204c7362be" + integrity sha512-2hHa/MpDunPnYK3QcZdHl4MOnyLlicBmohsM5/dfvfeoPp0faIjYKHbKyb8nKth/Zd4HhxtlMWfVKrmM9OMj/Q== + dependencies: + "@conventional-changelog/git-client" "^2.5.1" + "@types/normalize-package-data" "^2.4.4" + conventional-changelog-preset-loader "^5.0.0" + conventional-changelog-writer "^8.1.0" + conventional-commits-parser "^6.1.0" + fd-package-json "^1.2.0" + meow "^13.0.0" + normalize-package-data "^7.0.0" + conventional-commits-filter@^2.0.7: version "2.0.7" resolved "https://registry.yarnpkg.com/conventional-commits-filter/-/conventional-commits-filter-2.0.7.tgz#f8d9b4f182fce00c9af7139da49365b136c8a0b3" @@ -11635,7 +11695,12 @@ conventional-commits-filter@^2.0.7: lodash.ismatch "^4.4.0" modify-values "^1.0.0" -conventional-commits-parser@^3.2.0, conventional-commits-parser@^3.2.4: +conventional-commits-filter@^5.0.0: + version "5.0.0" + resolved "https://registry.yarnpkg.com/conventional-commits-filter/-/conventional-commits-filter-5.0.0.tgz#72811f95d379e79d2d39d5c0c53c9351ef284e86" + integrity sha512-tQMagCOC59EVgNZcC5zl7XqO30Wki9i9J3acbUvkaosCT6JX3EeFwJD7Qqp4MCikRnzS18WXV3BLIQ66ytu6+Q== + +conventional-commits-parser@^3.2.0: version "3.2.4" resolved "https://registry.yarnpkg.com/conventional-commits-parser/-/conventional-commits-parser-3.2.4.tgz#a7d3b77758a202a9b2293d2112a8d8052c740972" integrity sha512-nK7sAtfi+QXbxHCYfhpZsfRtaitZLIA6889kFIouLvz6repszQDgxBu7wf2WbU+Dco7sAnNCJYERCwt54WPC2Q== @@ -11657,6 +11722,13 @@ conventional-commits-parser@^5.0.0: meow "^12.0.1" split2 "^4.0.0" +conventional-commits-parser@^6.1.0, conventional-commits-parser@^6.2.0: + version "6.2.0" + resolved "https://registry.yarnpkg.com/conventional-commits-parser/-/conventional-commits-parser-6.2.0.tgz#1a2159471896f43101b8817e5709b8da78334aaa" + integrity sha512-uLnoLeIW4XaoFtH37qEcg/SXMJmKF4vi7V0H2rnPueg+VEtFGA/asSCNTcq4M/GQ6QmlzchAEtOoDTtKqWeHag== + dependencies: + meow "^13.0.0" + conventional-recommended-bump@^6.1.0: version "6.1.0" resolved "https://registry.yarnpkg.com/conventional-recommended-bump/-/conventional-recommended-bump-6.1.0.tgz#cfa623285d1de554012f2ffde70d9c8a22231f55" @@ -13703,6 +13775,13 @@ fbjs@^0.8.4: setimmediate "^1.0.5" ua-parser-js "^0.7.30" +fd-package-json@^1.2.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/fd-package-json/-/fd-package-json-1.2.0.tgz#4f218bb8ff65c21011d1f4f17cb3d0c9e72f8da7" + integrity sha512-45LSPmWf+gC5tdCQMNH4s9Sr00bIkiD9aN7dc5hqkrEw1geRYyDQS1v1oMHAW3ysfxfndqGsrDREHHjNNbKUfA== + dependencies: + walk-up-path "^3.0.1" + fetch-retry@^5.0.2: version "5.0.6" resolved "https://registry.yarnpkg.com/fetch-retry/-/fetch-retry-5.0.6.tgz#17d0bc90423405b7a88b74355bf364acd2a7fa56" @@ -14677,6 +14756,13 @@ hosted-git-info@^4.0.0, hosted-git-info@^4.0.1: dependencies: lru-cache "^6.0.0" +hosted-git-info@^8.0.0: + version "8.1.0" + resolved "https://registry.yarnpkg.com/hosted-git-info/-/hosted-git-info-8.1.0.tgz#153cd84c03c6721481e16a5709eb74b1a0ab2ed0" + integrity sha512-Rw/B2DNQaPBICNXEm8balFz9a6WpZrkCGpcWFpy7nCj+NyhSdqXipmfvtmWt9xGfp0wZnBxB+iVpLmQMYt47Tw== + dependencies: + lru-cache "^10.0.1" + html-entities@^2.1.0: version "2.4.0" resolved "https://registry.yarnpkg.com/html-entities/-/html-entities-2.4.0.tgz#edd0cee70402584c8c76cc2c0556db09d1f45061" @@ -16382,16 +16468,16 @@ lowlight@~1.11.0: fault "^1.0.2" highlight.js "~9.13.0" +lru-cache@^10.0.1, lru-cache@^10.2.0: + version "10.4.3" + resolved "https://registry.yarnpkg.com/lru-cache/-/lru-cache-10.4.3.tgz#410fc8a17b70e598013df257c2446b7f3383f119" + integrity sha512-JNAzZcXrCt42VGLuYz0zfAzDfAvJWW6AfYlDBQyDV5DClI2m5sAmK+OIO7s59XfsRsWHp02jAJrRadPRGTt6SQ== + lru-cache@^10.0.2, "lru-cache@^9.1.1 || ^10.0.0": version "10.1.0" resolved "https://registry.yarnpkg.com/lru-cache/-/lru-cache-10.1.0.tgz#2098d41c2dc56500e6c88584aa656c84de7d0484" integrity sha512-/1clY/ui8CzjKFyjdvwPWJUYKiFVXG2I2cY0ssG7h4+hwk+XOIX7ZSG9Q7TW8TW3Kp3BUSqgFWBLgL4PJ+Blag== -lru-cache@^10.2.0: - version "10.4.3" - resolved "https://registry.yarnpkg.com/lru-cache/-/lru-cache-10.4.3.tgz#410fc8a17b70e598013df257c2446b7f3383f119" - integrity sha512-JNAzZcXrCt42VGLuYz0zfAzDfAvJWW6AfYlDBQyDV5DClI2m5sAmK+OIO7s59XfsRsWHp02jAJrRadPRGTt6SQ== - lru-cache@^5.1.1: version "5.1.1" resolved "https://registry.yarnpkg.com/lru-cache/-/lru-cache-5.1.1.tgz#1da27e6710271947695daf6848e847f01d84b920" @@ -16582,6 +16668,11 @@ meow@^12.0.1: resolved "https://registry.yarnpkg.com/meow/-/meow-12.1.1.tgz#e558dddbab12477b69b2e9a2728c327f191bace6" integrity sha512-BhXM0Au22RwUneMPwSCnyhTOizdWoIEPU9sp0Aqa1PnDMR5Wv2FGXYDjuzJEIX+Eo2Rb8xuYe5jrnm5QowQFkw== +meow@^13.0.0: + version "13.2.0" + resolved "https://registry.yarnpkg.com/meow/-/meow-13.2.0.tgz#6b7d63f913f984063b3cc261b6e8800c4cd3474f" + integrity sha512-pxQJQzB6djGPXh08dacEloMFopsOqGVRKFPYvPOt9XDZ1HasbgDZA74CJGreSU4G3Ak7EFJGoiH2auq+yXISgA== + meow@^8.0.0: version "8.1.2" resolved "https://registry.yarnpkg.com/meow/-/meow-8.1.2.tgz#bcbe45bda0ee1729d350c03cffc8395a36c4e897" @@ -17072,6 +17163,15 @@ normalize-package-data@^3.0.0: semver "^7.3.4" validate-npm-package-license "^3.0.1" +normalize-package-data@^7.0.0: + version "7.0.0" + resolved "https://registry.yarnpkg.com/normalize-package-data/-/normalize-package-data-7.0.0.tgz#ab4f49d02f2e25108d3f4326f3c13f0de6fa6a0a" + integrity sha512-k6U0gKRIuNCTkwHGZqblCfLfBRh+w1vI6tBo+IeJwq2M8FUiOqhX7GH+GArQGScA7azd1WfyRCvxoXDO3hQDIA== + dependencies: + hosted-git-info "^8.0.0" + semver "^7.3.5" + validate-npm-package-license "^3.0.4" + normalize-path@^3.0.0, normalize-path@~3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/normalize-path/-/normalize-path-3.0.0.tgz#0dcd69ff23a1c9b11fd0978316644a0388216a65" @@ -19956,16 +20056,7 @@ string-argv@0.3.2: resolved "https://registry.yarnpkg.com/string-argv/-/string-argv-0.3.2.tgz#2b6d0ef24b656274d957d54e0a4bbf6153dc02b6" integrity sha512-aqD2Q0144Z+/RqG52NeHEkZauTAUWJO8c6yTftGJKO3Tja5tUgIfmIl6kExvhtxSDP7fXB6DvzkfMpCd/F3G+Q== -"string-width-cjs@npm:string-width@^4.2.0": - version "4.2.3" - resolved "https://registry.yarnpkg.com/string-width/-/string-width-4.2.3.tgz#269c7117d27b05ad2e536830a8ec895ef9c6d010" - integrity sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g== - dependencies: - emoji-regex "^8.0.0" - is-fullwidth-code-point "^3.0.0" - strip-ansi "^6.0.1" - -string-width@^4.1.0, string-width@^4.2.0, string-width@^4.2.3: +"string-width-cjs@npm:string-width@^4.2.0", string-width@^4.1.0, string-width@^4.2.0, string-width@^4.2.3: version "4.2.3" resolved "https://registry.yarnpkg.com/string-width/-/string-width-4.2.3.tgz#269c7117d27b05ad2e536830a8ec895ef9c6d010" integrity sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g== @@ -20101,14 +20192,7 @@ stringify-object@^5.0.0: is-obj "^3.0.0" is-regexp "^3.1.0" -"strip-ansi-cjs@npm:strip-ansi@^6.0.1": - version "6.0.1" - resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-6.0.1.tgz#9e26c63d30f53443e9489495b2105d37b67a85d9" - integrity sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A== - dependencies: - ansi-regex "^5.0.1" - -strip-ansi@^6.0.0, strip-ansi@^6.0.1: +"strip-ansi-cjs@npm:strip-ansi@^6.0.1", strip-ansi@^6.0.0, strip-ansi@^6.0.1: version "6.0.1" resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-6.0.1.tgz#9e26c63d30f53443e9489495b2105d37b67a85d9" integrity sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A== @@ -21186,7 +21270,7 @@ valibot@^0.36.0, valibot@^0.38.0: resolved "https://registry.yarnpkg.com/valibot/-/valibot-0.38.0.tgz#2d035d2a5bd36e8ea8b48b56d44552ace1a7616f" integrity sha512-RCJa0fetnzp+h+KN9BdgYOgtsMAG9bfoJ9JSjIhFHobKWVWyzM3jjaeNTdpFK9tQtf3q1sguXeERJ/LcmdFE7w== -validate-npm-package-license@^3.0.1: +validate-npm-package-license@^3.0.1, validate-npm-package-license@^3.0.4: version "3.0.4" resolved "https://registry.yarnpkg.com/validate-npm-package-license/-/validate-npm-package-license-3.0.4.tgz#fc91f6b9c7ba15c857f4cb2c5defeec39d4f410a" integrity sha512-DpKm2Ui/xN7/HQKCtpZxoRWBhZ9Z0kqtygG8XCgNQ8ZlDnxuQmWhj566j8fN4Cu3/JmbhsDo7fcAJq4s9h27Ew== @@ -21316,6 +21400,11 @@ void-elements@3.1.0: resolved "https://registry.yarnpkg.com/void-elements/-/void-elements-3.1.0.tgz#614f7fbf8d801f0bb5f0661f5b2f5785750e4f09" integrity sha512-Dhxzh5HZuiHQhbvTW9AMetFfBHDMYpo23Uo9btPXgdYP+3T5S+p+jgNy7spra+veYhBP2dCSgxR/i2Y02h5/6w== +walk-up-path@^3.0.1: + version "3.0.1" + resolved "https://registry.yarnpkg.com/walk-up-path/-/walk-up-path-3.0.1.tgz#c8d78d5375b4966c717eb17ada73dbd41490e886" + integrity sha512-9YlCL/ynK3CTlrSRrDxZvUauLzAswPCrsaCgilqFevUYpeEW0/3ScEjaa3kbW/T0ghhkEr7mv+fpjqn1Y1YuTA== + warning@^4.0.2, warning@^4.0.3: version "4.0.3" resolved "https://registry.yarnpkg.com/warning/-/warning-4.0.3.tgz#16e9e077eb8a86d6af7d64aa1e05fd85b4678ca3" @@ -21812,7 +21901,7 @@ wordwrap@^1.0.0: resolved "https://registry.yarnpkg.com/wordwrap/-/wordwrap-1.0.0.tgz#27584810891456a4171c8d0226441ade90cbcaeb" integrity sha512-gvVzJFlPycKc5dZN4yPkP8w7Dc37BtP1yczEneOb4uq34pXZcvrtRTmWV8W+Ume+XCxKgbjM+nevkyFPMybd4Q== -"wrap-ansi-cjs@npm:wrap-ansi@^7.0.0": +"wrap-ansi-cjs@npm:wrap-ansi@^7.0.0", wrap-ansi@^7.0.0: version "7.0.0" resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-7.0.0.tgz#67e145cff510a6a6984bdf1152911d69d2eb9e43" integrity sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q== @@ -21830,15 +21919,6 @@ wrap-ansi@^6.2.0: string-width "^4.1.0" strip-ansi "^6.0.0" -wrap-ansi@^7.0.0: - version "7.0.0" - resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-7.0.0.tgz#67e145cff510a6a6984bdf1152911d69d2eb9e43" - integrity sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q== - dependencies: - ansi-styles "^4.0.0" - string-width "^4.1.0" - strip-ansi "^6.0.0" - wrap-ansi@^8.0.1, wrap-ansi@^8.1.0: version "8.1.0" resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-8.1.0.tgz#56dc22368ee570face1b49819975d9b9a5ead214" From e7776b09ed628209eb4596b96d49585602bfb39e Mon Sep 17 00:00:00 2001 From: Eren Yeager Date: Sat, 26 Jul 2025 21:57:09 +0000 Subject: [PATCH 2/8] chore: conventional-commits-filter and parser have upgraded, fix its breaking changes --- scripts/check-conventional-commits/command.mjs | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/scripts/check-conventional-commits/command.mjs b/scripts/check-conventional-commits/command.mjs index 979f38a58b..eee628098d 100644 --- a/scripts/check-conventional-commits/command.mjs +++ b/scripts/check-conventional-commits/command.mjs @@ -1,8 +1,8 @@ import { execa } from 'execa'; import { logAsSection } from '../publish/utils.mjs'; import { detectChannel } from '../common/github.mjs'; -import parser from 'conventional-commits-parser'; -import filter from 'conventional-commits-filter'; +import { CommitParser } from 'conventional-commits-parser'; +import { filterRevertedCommitsSync } from 'conventional-commits-filter'; async function run() { const channel = detectChannel(); @@ -15,7 +15,12 @@ async function run() { '--pretty=format:%B__________', ]); const commits = logs.split('__________').filter(Boolean); - const parsedCommits = filter(commits.map(parser.sync)); + + const parser = new CommitParser(); + const parsedCommits = Array.from( + filterRevertedCommitsSync(commits.map((commit) => parser.parse(commit))) + ); + const hasAnyConventionalCommit = parsedCommits.some( (commit) => !!commit.type ); From 33e2804d24b8e82422e70143d0928745a5a7acd7 Mon Sep 17 00:00:00 2001 From: Eren Yeager Date: Mon, 28 Jul 2025 03:52:59 +0000 Subject: [PATCH 3/8] chore: add root changelog flow and also clean ups for reveiw --- scripts/changelog/command.mjs | 85 ++++++++++++++++---------- scripts/common/changelog.mjs | 111 +++++++++++++++++++++++++--------- 2 files changed, 137 insertions(+), 59 deletions(-) diff --git a/scripts/changelog/command.mjs b/scripts/changelog/command.mjs index de6fc27a35..bdf46bfe19 100644 --- a/scripts/changelog/command.mjs +++ b/scripts/changelog/command.mjs @@ -1,12 +1,9 @@ #!/usr/bin/env node 'use strict'; -import { discoverWorkspacePackages } from '../common/repository.mjs'; import commandLineArgs from 'command-line-args'; import { - generateChangelog, getInfoBeforeGeneratingChangelog, - changelogFileStream, generateChangelogAndSave, generateChangelogAndPrint, } from '../common/changelog.mjs'; @@ -15,39 +12,25 @@ import { packageNamesToPackagesWithInfo, } from '../common/utils.mjs'; -// NOTE: changelog should be run before the tagging proccess for the new release. +async function generateChangelogForRoot(options) { + const { from, commitsCount } = await getInfoBeforeGeneratingChangelog(); -// TODO: Add single repo flow for genrating changelog, the whole assumption here is we are in a monorepo. -async function run() { - const optionDefinitions = [ - { name: 'name', type: String }, - { name: 'save', type: Boolean }, - ]; - const { name, save } = commandLineArgs(optionDefinitions); - - // Create a list of packages we are going to create changelog for. - const packages = []; - if (name) { - const pkgs = await packageNamesToPackagesWithInfo([name]); - if (pkgs.length !== 1) - throw new Error('Your provided package is not found.', { cause: pkgs }); + if (commitsCount > 0) { + console.log('from:', from || 'start (first release)'); + console.log('commits:', commitsCount); - packages.push(pkgs[0]); + if (options.save) { + generateChangelogAndSave(); + } else { + generateChangelogAndPrint(); + } } else { - console.warn( - "You didn't specify any package name, so we will consider this as all the public packages should be considered." - ); - - const list = await workspacePackages(); - list - .filter((pkg) => !pkg.private) - .forEach((pkg) => { - packages.push(pkg); - }); + console.log(`No commits found, skipping changelog generation.`); } +} - // Try generate changelog for each of them. - for (const pkg of packages) { +async function generateChangelogForWorkspaceMembers(pkgs) { + for (const pkg of pkgs) { const { from, commitsCount } = await getInfoBeforeGeneratingChangelog(pkg); if (commitsCount > 0) { @@ -68,6 +51,46 @@ async function run() { } } +// NOTE 1: changelog should be run before the tagging proccess for the new release. checkout the steps here: https://github.com/conventional-changelog/conventional-changelog/tree/master/packages/conventional-changelog#recommended-workflow +// NOTE 2: we use tags. tags with package@semver format. +// NOTE 3: when don't use any flag, we will last valid tag as starting point. +async function run() { + const optionDefinitions = [ + { name: 'name', type: String }, + { name: 'save', type: Boolean }, + { name: 'all', type: Boolean }, + ]; + const { name, save, all } = commandLineArgs(optionDefinitions); + + if (name && all) + throw new Error('One of the --name or --all flag should be given'); + + if (name || all) { + // Create a list of packages we are going to create changelog for. + const pkgs = []; + if (name) { + const pkgs = await packageNamesToPackagesWithInfo([name]); + if (pkgs.length !== 1) + throw new Error('Your provided package is not found.', { cause: pkgs }); + + pkgs.push(pkgs[0]); + } else { + const list = await workspacePackages(); + list + .filter((pkg) => !pkg.private) + .forEach((pkg) => { + pkgs.push(pkg); + }); + } + + await generateChangelogForWorkspaceMembers(pkgs); + } else { + await generateChangelogForRoot({ + save, + }); + } +} + run().catch((e) => { console.error(e); process.exit(1); diff --git a/scripts/common/changelog.mjs b/scripts/common/changelog.mjs index 81d1a75dc2..9bafb60dc9 100644 --- a/scripts/common/changelog.mjs +++ b/scripts/common/changelog.mjs @@ -5,27 +5,68 @@ import { WriteStream } from 'node:fs'; import fs from 'node:fs'; import path from 'node:path'; +// Our tagging is using lerna convention which is package-name@version +// for example for @rango-dev/wallets-core, it will be wallets-core@1.1.0 +const TAG_PACKAGE_PREFIX = (pkg) => `${packageNameWithoutScope(pkg.name)}@`; +const TAG_ROOT_PREFIX = /^[^@]+@/; + +// TODO: this is not correct assumption that the script will be run from the root. +// I made it a function to make it easier correct behaviour in future. +function rootPath() { + return path.join('.'); +} +function rootPackageJson() { + return path.join(rootPath(), 'package.json'); +} + /** * Retrieving some useful information when you are going to generate a changelog * - * @param {import("./typedefs.mjs").Package} pkg + * @param {import("./typedefs.mjs").Package} [pkg] */ export async function getInfoBeforeGeneratingChangelog(pkg) { const gitClient = new ConventionalGitClient(process.cwd()); - const tagsParams = { - prefix: `${packageNameWithoutScope(pkg.name)}@`, - }; - const semverTagsStream = gitClient.getSemverTags(tagsParams); - const semverTags = []; - for await (const tag of semverTagsStream) { - semverTags.push(tag); - } - const commitsParams = { + let commitsParams = { merges: false, - from: semverTags[0], - path: pkg.location, }; + + let startFromTag = undefined; + if (pkg) { + const tagsParams = { + prefix: TAG_PACKAGE_PREFIX(pkg), + }; + const semverTagsStream = gitClient.getSemverTags(tagsParams); + + const semverTags = []; + for await (const tag of semverTagsStream) { + semverTags.push(tag); + } + startFromTag = semverTags[0]; + + commitsParams = { + ...commitsParams, + from: startFromTag, + path: pkg.location, + }; + } else { + const semverTag = await gitClient.getLastSemverTag({ + // HEADS UP: + // The following regex pattern supports the `package@1.1.1` format, which meets our needs for now. + // scoped tags like `@a/b@1.1.1` are not currently supported. + prefix: TAG_ROOT_PREFIX, + }); + // If there are no semver tags, null is returned. In that case, we change it undefined to match the `string | undefined` signature. + startFromTag = semverTag || undefined; + + if (startFromTag) { + commitsParams = { + ...commitsParams, + from: startFromTag, + }; + } + } + const commitsStream = gitClient.getCommits(commitsParams); const commits = []; @@ -35,7 +76,7 @@ export async function getInfoBeforeGeneratingChangelog(pkg) { return { /** Where is considering as starting point, it is genrally a tag. undefined means it's the first release.'*/ - from: semverTags[0], + from: startFromTag, /** How many commits this release has. */ commitsCount: commits.length, }; @@ -58,38 +99,52 @@ export function changelogFileStream(pkg) { } /** + * * Generate a changelog by using convetional commit format. * It uses tags to identify releases. * - * @param {import("./typedefs.mjs").Package} pkg - * @returns {WriteStream} + * @param {import("./typedefs.mjs").Package} [pkg] + * @returns {ReadableStream} */ -export async function generateChangelog(pkg) { +export function generateChangelog(pkg) { const generator = new ConventionalChangelog(process.cwd()); - // TODO: idk why without .json at the was working before - generator.readPackage(`${pkg.location}/package.json`); generator.loadPreset('angular'); - let commitsOptions = { - path: pkg.location, - }; + if (pkg) { + generator.readPackage(`${pkg.location}/package.json`); + generator.commits({ + path: pkg.location, + }); - // Our tagging is using lerna convention which is package-name@version - // for example for @rango-dev/wallets-core, it will be wallets-core@1.1.0 - const tagName = packageNameWithoutScope(pkg.name); - generator.tags({ - prefix: `${tagName}@`, - }); - generator.commits(commitsOptions); + generator.tags({ + prefix: TAG_PACKAGE_PREFIX(pkg), + }); + } else { + generator.readPackage(rootPackageJson()); + generator.tags({ + prefix: TAG_ROOT_PREFIX, + }); + } return generator.writeStream(); } +/** + * + * @param {import("./typedefs.mjs").Package} [pkg] + */ export function generateChangelogAndSave(pkg) { const changelog = generateChangelog(pkg); + + // we only need location for file stream, when pkg is undefined, we will point to root package.json + if (!pkg) pkg = { location: rootPath() }; changelog.pipe(changelogFileStream(pkg)); } +/** + * + * @param {import("./typedefs.mjs").Package} [pkg] + */ export function generateChangelogAndPrint(pkg) { const changelog = generateChangelog(pkg); changelog.pipe(process.stdout); From 211fed1f686dbae5f523f22215add3514264c5b0 Mon Sep 17 00:00:00 2001 From: Eren Yeager Date: Mon, 28 Jul 2025 06:38:11 +0000 Subject: [PATCH 4/8] chore: we don't need this package anymore --- package.json | 1 - yarn.lock | 260 +-------------------------------------------------- 2 files changed, 5 insertions(+), 256 deletions(-) diff --git a/package.json b/package.json index 390462edfe..ee82f4d68a 100644 --- a/package.json +++ b/package.json @@ -84,7 +84,6 @@ "command-line-args": "^5.2.1", "conventional-changelog": "^7.1.0", "conventional-changelog-angular": "^8.0.0", - "conventional-changelog-cli": "^2.2.2", "conventional-commits-filter": "^5.0.0", "conventional-commits-parser": "^6.2.0", "conventional-recommended-bump": "^6.1.0", diff --git a/yarn.lock b/yarn.lock index 226ffcb02d..ea25ae6312 100644 --- a/yarn.lock +++ b/yarn.lock @@ -4052,11 +4052,6 @@ resolved "https://registry.yarnpkg.com/@humanwhocodes/retry/-/retry-0.4.1.tgz#9a96ce501bc62df46c4031fbd970e3cc6b10f07b" integrity sha512-c7hNEllBlenFTHBky65mhq8WD2kbN9Q6gk0bTk8lSBvc554jpXSkST1iePudpt7+A/AQvuHs9EMqjHDXMY1lrA== -"@hutson/parse-repository-url@^3.0.0": - version "3.0.2" - resolved "https://registry.yarnpkg.com/@hutson/parse-repository-url/-/parse-repository-url-3.0.2.tgz#98c23c950a3d9b6c8f0daed06da6c3af06981340" - integrity sha512-H9XAx3hc0BQHY6l+IFSWHDySypcXsvsuLhgYLUGywmJ5pswRVQJUHpOsobnLYp2ZUaUlKiKDrgWWhosOwAEM8Q== - "@hypnosphi/create-react-context@^0.3.1": version "0.3.1" resolved "https://registry.yarnpkg.com/@hypnosphi/create-react-context/-/create-react-context-0.3.1.tgz#f8bfebdc7665f5d426cba3753e0e9c7d3154d7c6" @@ -9908,11 +9903,6 @@ acorn@^8.14.0: resolved "https://registry.yarnpkg.com/acorn/-/acorn-8.14.0.tgz#063e2c70cac5fb4f6467f0b11152e04c682795b0" integrity sha512-cl669nCJTZBsL97OF4kUQm5g5hC2uihk0NxY3WENAC0TYdILVkAyHymAntgxGkl7K+t0cXIrH5siy5S4XkFycA== -add-stream@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/add-stream/-/add-stream-1.0.0.tgz#6a7990437ca736d5e1288db92bd3266d5f5cb2aa" - integrity sha512-qQLMr+8o0WC4FZGQTcJiKBVC59JylcPSrTtk6usvmIDFUOCKegapy1VHQwRbFMOFyb/inzUVqHs+eMYKDM1YeQ== - address@^1.0.1: version "1.2.2" resolved "https://registry.yarnpkg.com/address/-/address-1.2.2.tgz#2b5248dac5485a6390532c6a517fda2e3faac89e" @@ -11502,14 +11492,6 @@ content-type@~1.0.4, content-type@~1.0.5: resolved "https://registry.yarnpkg.com/content-type/-/content-type-1.0.5.tgz#8b773162656d1d1086784c8f23a54ce6d73d7918" integrity sha512-nTjqfcBFEipKdXCv4YDQWCfmcLZKm81ldF0pAopTvyrFGVbcR6P/VAAd5G7N+0tTr8QqiU0tFadD6FK4NtJwOA== -conventional-changelog-angular@^5.0.12: - version "5.0.13" - resolved "https://registry.yarnpkg.com/conventional-changelog-angular/-/conventional-changelog-angular-5.0.13.tgz#896885d63b914a70d4934b59d2fe7bde1832b28c" - integrity sha512-i/gipMxs7s8L/QeuavPF2hLnJgH6pEZAttySB6aiQLWcX3puWDL3ACVmvBhJGxnAy52Qc15ua26BufY6KpmrVA== - dependencies: - compare-func "^2.0.0" - q "^1.5.1" - conventional-changelog-angular@^7.0.0: version "7.0.0" resolved "https://registry.yarnpkg.com/conventional-changelog-angular/-/conventional-changelog-angular-7.0.0.tgz#5eec8edbff15aa9b1680a8dcfbd53e2d7eb2ba7a" @@ -11524,40 +11506,6 @@ conventional-changelog-angular@^8.0.0: dependencies: compare-func "^2.0.0" -conventional-changelog-atom@^2.0.8: - version "2.0.8" - resolved "https://registry.yarnpkg.com/conventional-changelog-atom/-/conventional-changelog-atom-2.0.8.tgz#a759ec61c22d1c1196925fca88fe3ae89fd7d8de" - integrity sha512-xo6v46icsFTK3bb7dY/8m2qvc8sZemRgdqLb/bjpBsH2UyOS8rKNTgcb5025Hri6IpANPApbXMg15QLb1LJpBw== - dependencies: - q "^1.5.1" - -conventional-changelog-cli@^2.2.2: - version "2.2.2" - resolved "https://registry.yarnpkg.com/conventional-changelog-cli/-/conventional-changelog-cli-2.2.2.tgz#9a7746cede92c6a8f27dc46692efaadfbed60daa" - integrity sha512-8grMV5Jo8S0kP3yoMeJxV2P5R6VJOqK72IiSV9t/4H5r/HiRqEBQ83bYGuz4Yzfdj4bjaAEhZN/FFbsFXr5bOA== - dependencies: - add-stream "^1.0.0" - conventional-changelog "^3.1.24" - lodash "^4.17.15" - meow "^8.0.0" - tempfile "^3.0.0" - -conventional-changelog-codemirror@^2.0.8: - version "2.0.8" - resolved "https://registry.yarnpkg.com/conventional-changelog-codemirror/-/conventional-changelog-codemirror-2.0.8.tgz#398e9530f08ce34ec4640af98eeaf3022eb1f7dc" - integrity sha512-z5DAsn3uj1Vfp7po3gpt2Boc+Bdwmw2++ZHa5Ak9k0UKsYAO5mH1UBTN0qSCuJZREIhX6WU4E1p3IW2oRCNzQw== - dependencies: - q "^1.5.1" - -conventional-changelog-conventionalcommits@^4.5.0: - version "4.6.3" - resolved "https://registry.yarnpkg.com/conventional-changelog-conventionalcommits/-/conventional-changelog-conventionalcommits-4.6.3.tgz#0765490f56424b46f6cb4db9135902d6e5a36dc2" - integrity sha512-LTTQV4fwOM4oLPad317V/QNQ1FY4Hju5qeBIM1uTHbrnCE+Eg4CdRZ3gO2pUeR+tzWdp80M2j3qFFEDWVqOV4g== - dependencies: - compare-func "^2.0.0" - lodash "^4.17.15" - q "^1.5.1" - conventional-changelog-conventionalcommits@^7.0.2: version "7.0.2" resolved "https://registry.yarnpkg.com/conventional-changelog-conventionalcommits/-/conventional-changelog-conventionalcommits-7.0.2.tgz#aa5da0f1b2543094889e8cf7616ebe1a8f5c70d5" @@ -11565,62 +11513,6 @@ conventional-changelog-conventionalcommits@^7.0.2: dependencies: compare-func "^2.0.0" -conventional-changelog-core@^4.2.1: - version "4.2.4" - resolved "https://registry.yarnpkg.com/conventional-changelog-core/-/conventional-changelog-core-4.2.4.tgz#e50d047e8ebacf63fac3dc67bf918177001e1e9f" - integrity sha512-gDVS+zVJHE2v4SLc6B0sLsPiloR0ygU7HaDW14aNJE1v4SlqJPILPl/aJC7YdtRE4CybBf8gDwObBvKha8Xlyg== - dependencies: - add-stream "^1.0.0" - conventional-changelog-writer "^5.0.0" - conventional-commits-parser "^3.2.0" - dateformat "^3.0.0" - get-pkg-repo "^4.0.0" - git-raw-commits "^2.0.8" - git-remote-origin-url "^2.0.0" - git-semver-tags "^4.1.1" - lodash "^4.17.15" - normalize-package-data "^3.0.0" - q "^1.5.1" - read-pkg "^3.0.0" - read-pkg-up "^3.0.0" - through2 "^4.0.0" - -conventional-changelog-ember@^2.0.9: - version "2.0.9" - resolved "https://registry.yarnpkg.com/conventional-changelog-ember/-/conventional-changelog-ember-2.0.9.tgz#619b37ec708be9e74a220f4dcf79212ae1c92962" - integrity sha512-ulzIReoZEvZCBDhcNYfDIsLTHzYHc7awh+eI44ZtV5cx6LVxLlVtEmcO+2/kGIHGtw+qVabJYjdI5cJOQgXh1A== - dependencies: - q "^1.5.1" - -conventional-changelog-eslint@^3.0.9: - version "3.0.9" - resolved "https://registry.yarnpkg.com/conventional-changelog-eslint/-/conventional-changelog-eslint-3.0.9.tgz#689bd0a470e02f7baafe21a495880deea18b7cdb" - integrity sha512-6NpUCMgU8qmWmyAMSZO5NrRd7rTgErjrm4VASam2u5jrZS0n38V7Y9CzTtLT2qwz5xEChDR4BduoWIr8TfwvXA== - dependencies: - q "^1.5.1" - -conventional-changelog-express@^2.0.6: - version "2.0.6" - resolved "https://registry.yarnpkg.com/conventional-changelog-express/-/conventional-changelog-express-2.0.6.tgz#420c9d92a347b72a91544750bffa9387665a6ee8" - integrity sha512-SDez2f3iVJw6V563O3pRtNwXtQaSmEfTCaTBPCqn0oG0mfkq0rX4hHBq5P7De2MncoRixrALj3u3oQsNK+Q0pQ== - dependencies: - q "^1.5.1" - -conventional-changelog-jquery@^3.0.11: - version "3.0.11" - resolved "https://registry.yarnpkg.com/conventional-changelog-jquery/-/conventional-changelog-jquery-3.0.11.tgz#d142207400f51c9e5bb588596598e24bba8994bf" - integrity sha512-x8AWz5/Td55F7+o/9LQ6cQIPwrCjfJQ5Zmfqi8thwUEKHstEn4kTIofXub7plf1xvFA2TqhZlq7fy5OmV6BOMw== - dependencies: - q "^1.5.1" - -conventional-changelog-jshint@^2.0.9: - version "2.0.9" - resolved "https://registry.yarnpkg.com/conventional-changelog-jshint/-/conventional-changelog-jshint-2.0.9.tgz#f2d7f23e6acd4927a238555d92c09b50fe3852ff" - integrity sha512-wMLdaIzq6TNnMHMy31hql02OEQ8nCQfExw1SE0hYL5KvU+JCTuPaDO+7JiogGT2gJAxiUGATdtYYfh+nT+6riA== - dependencies: - compare-func "^2.0.0" - q "^1.5.1" - conventional-changelog-preset-loader@^2.3.4: version "2.3.4" resolved "https://registry.yarnpkg.com/conventional-changelog-preset-loader/-/conventional-changelog-preset-loader-2.3.4.tgz#14a855abbffd59027fd602581f1f34d9862ea44c" @@ -11631,21 +11523,6 @@ conventional-changelog-preset-loader@^5.0.0: resolved "https://registry.yarnpkg.com/conventional-changelog-preset-loader/-/conventional-changelog-preset-loader-5.0.0.tgz#922ad617c13ad3243bef967cfc0f8373893c216d" integrity sha512-SetDSntXLk8Jh1NOAl1Gu5uLiCNSYenB5tm0YVeZKePRIgDW9lQImromTwLa3c/Gae298tsgOM+/CYT9XAl0NA== -conventional-changelog-writer@^5.0.0: - version "5.0.1" - resolved "https://registry.yarnpkg.com/conventional-changelog-writer/-/conventional-changelog-writer-5.0.1.tgz#e0757072f045fe03d91da6343c843029e702f359" - integrity sha512-5WsuKUfxW7suLblAbFnxAcrvf6r+0b7GvNaWUwUIk0bXMnENP/PEieGKVUQrjPqwPT4o3EPAASBXiY6iHooLOQ== - dependencies: - conventional-commits-filter "^2.0.7" - dateformat "^3.0.0" - handlebars "^4.7.7" - json-stringify-safe "^5.0.1" - lodash "^4.17.15" - meow "^8.0.0" - semver "^6.0.0" - split "^1.0.0" - through2 "^4.0.0" - conventional-changelog-writer@^8.1.0: version "8.2.0" resolved "https://registry.yarnpkg.com/conventional-changelog-writer/-/conventional-changelog-writer-8.2.0.tgz#1b77ef8e45ccc4559e02a23a34d50c15d2051e5a" @@ -11656,23 +11533,6 @@ conventional-changelog-writer@^8.1.0: meow "^13.0.0" semver "^7.5.2" -conventional-changelog@^3.1.24: - version "3.1.25" - resolved "https://registry.yarnpkg.com/conventional-changelog/-/conventional-changelog-3.1.25.tgz#3e227a37d15684f5aa1fb52222a6e9e2536ccaff" - integrity sha512-ryhi3fd1mKf3fSjbLXOfK2D06YwKNic1nC9mWqybBHdObPd8KJ2vjaXZfYj1U23t+V8T8n0d7gwnc9XbIdFbyQ== - dependencies: - conventional-changelog-angular "^5.0.12" - conventional-changelog-atom "^2.0.8" - conventional-changelog-codemirror "^2.0.8" - conventional-changelog-conventionalcommits "^4.5.0" - conventional-changelog-core "^4.2.1" - conventional-changelog-ember "^2.0.9" - conventional-changelog-eslint "^3.0.9" - conventional-changelog-express "^2.0.6" - conventional-changelog-jquery "^3.0.11" - conventional-changelog-jshint "^2.0.9" - conventional-changelog-preset-loader "^2.3.4" - conventional-changelog@^7.1.0: version "7.1.0" resolved "https://registry.yarnpkg.com/conventional-changelog/-/conventional-changelog-7.1.0.tgz#3b2c0fd34f62b754b140f00bdb76fb204c7362be" @@ -12195,11 +12055,6 @@ date-fns@^2.16.1, date-fns@^2.29.3: dependencies: "@babel/runtime" "^7.21.0" -dateformat@^3.0.0: - version "3.0.3" - resolved "https://registry.yarnpkg.com/dateformat/-/dateformat-3.0.3.tgz#a6e37499a4d9a9cf85ef5872044d62901c9889ae" - integrity sha512-jyCETtSl3VMZMWeRo7iY1FL19ges1t55hMo5yaam4Jrsm5EPL89UQkoQRyiI+Yf4k8r2ZpdngkV8hr1lIdjb3Q== - dayjs@^1.11.6: version "1.11.13" resolved "https://registry.yarnpkg.com/dayjs/-/dayjs-1.11.13.tgz#92430b0139055c3ebb60150aa13e860a4b5a366c" @@ -13894,13 +13749,6 @@ find-root@^1.1.0: resolved "https://registry.yarnpkg.com/find-root/-/find-root-1.1.0.tgz#abcfc8ba76f708c42a97b3d685b7e9450bfb9ce4" integrity sha512-NKfW6bec6GfKc0SGx1e07QZY9PE99u0Bft/0rzSD5k3sO/vwkVUpDUKVm5Gpp5Ue3YfShPFTX2070tDs5kB9Ng== -find-up@^2.0.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/find-up/-/find-up-2.1.0.tgz#45d1b7e506c717ddd482775a2b77920a3c0c57a7" - integrity sha512-NWzkk0jSJtTt08+FBFMvXoeZnOJD+jTtsRmBYbAIzJdX6l7dLgR7CTubCM5/eDdPUBvLCeVasP1brfVR/9/EZQ== - dependencies: - locate-path "^2.0.0" - find-up@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/find-up/-/find-up-3.0.0.tgz#49169f1d7993430646da61ecc5ae355c21c97b73" @@ -14194,16 +14042,6 @@ get-own-enumerable-keys@^1.0.0: resolved "https://registry.yarnpkg.com/get-own-enumerable-keys/-/get-own-enumerable-keys-1.0.0.tgz#59bbda0f7e7469c8c74086e08f79f1381b203899" integrity sha512-PKsK2FSrQCyxcGHsGrLDcK0lx+0Ke+6e8KFFozA9/fIQLhQzPaRvJFdcz7+Axg3jUH/Mq+NI4xa5u/UT2tQskA== -get-pkg-repo@^4.0.0: - version "4.2.1" - resolved "https://registry.yarnpkg.com/get-pkg-repo/-/get-pkg-repo-4.2.1.tgz#75973e1c8050c73f48190c52047c4cee3acbf385" - integrity sha512-2+QbHjFRfGB74v/pYWjd5OhU3TDIC2Gv/YKUTk/tCvAz0pkn/Mz6P3uByuBimLOcPvN2jYdScl3xGFSrx0jEcA== - dependencies: - "@hutson/parse-repository-url" "^3.0.0" - hosted-git-info "^4.0.0" - through2 "^2.0.0" - yargs "^16.2.0" - get-port-please@^3.1.1: version "3.1.1" resolved "https://registry.yarnpkg.com/get-port-please/-/get-port-please-3.1.1.tgz#2556623cddb4801d823c0a6a15eec038abb483be" @@ -14273,14 +14111,6 @@ git-raw-commits@^2.0.11, git-raw-commits@^2.0.8: split2 "^3.0.0" through2 "^4.0.0" -git-remote-origin-url@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/git-remote-origin-url/-/git-remote-origin-url-2.0.0.tgz#5282659dae2107145a11126112ad3216ec5fa65f" - integrity sha512-eU+GGrZgccNJcsDH5LkXR3PB9M958hxc7sbA8DFJjrv9j4L2P/eZfKhM+QD6wyzpiv+b1BpK0XrYCxkovtjSLw== - dependencies: - gitconfiglocal "^1.0.0" - pify "^2.3.0" - git-semver-tags@^4.1.1: version "4.1.1" resolved "https://registry.yarnpkg.com/git-semver-tags/-/git-semver-tags-4.1.1.tgz#63191bcd809b0ec3e151ba4751c16c444e5b5780" @@ -14289,13 +14119,6 @@ git-semver-tags@^4.1.1: meow "^8.0.0" semver "^6.0.0" -gitconfiglocal@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/gitconfiglocal/-/gitconfiglocal-1.0.0.tgz#41d045f3851a5ea88f03f24ca1c6178114464b9b" - integrity sha512-spLUXeTAVHxDtKsJc8FkFVgFtMdEN9qPGpL23VfSHx4fP4+Ds097IXLvymbnDH8FnmxX5Nr9bPw3A+AQ6mWEaQ== - dependencies: - ini "^1.3.2" - github-slugger@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/github-slugger/-/github-slugger-2.0.0.tgz#52cf2f9279a21eb6c59dd385b410f0c0adda8f1a" @@ -14749,7 +14572,7 @@ hosted-git-info@^2.1.4: resolved "https://registry.yarnpkg.com/hosted-git-info/-/hosted-git-info-2.8.9.tgz#dffc0bf9a21c02209090f2aa69429e1414daf3f9" integrity sha512-mxIDAb9Lsm6DoOJ7xH+5+X4y1LU/4Hi50L9C5sIswK3JzULS4bwk1FvjdBgvYR4bzT4tuUQiC15FE2f5HbLvYw== -hosted-git-info@^4.0.0, hosted-git-info@^4.0.1: +hosted-git-info@^4.0.1: version "4.1.0" resolved "https://registry.yarnpkg.com/hosted-git-info/-/hosted-git-info-4.1.0.tgz#827b82867e9ff1c8d0c4d9d53880397d2c86d224" integrity sha512-kyCuEOWjJqZuDbRHzL8V93NzQhwIB71oFWSyzVo+KPZI+pnQPPxucdkrOZvkLRnrf5URsQM+IJ09Dw29cRALIA== @@ -14987,7 +14810,7 @@ inherits@2, inherits@2.0.4, inherits@^2.0.1, inherits@^2.0.3, inherits@^2.0.4, i resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.4.tgz#0fa2c64f932917c3433a0ded55363aae37416b7c" integrity sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ== -ini@^1.3.2, ini@^1.3.4: +ini@^1.3.4: version "1.3.8" resolved "https://registry.yarnpkg.com/ini/-/ini-1.3.8.tgz#a29da425b48806f34767a4efce397269af28432c" integrity sha512-JV/yugV2uzW5iMRSiZAyDtQd+nxtUnjeLt0acNdw98kKLrvuRVyB80tsREOE7yvGVgalhZ6RNXCmEHkUKBKxew== @@ -16255,14 +16078,6 @@ localforage@^1.8.1: dependencies: lie "3.1.1" -locate-path@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/locate-path/-/locate-path-2.0.0.tgz#2b568b265eec944c6d9c0de9c3dbbbca0354cd8e" - integrity sha512-NCI2kiDkyR7VeEKm27Kda/iQHyKJe1Bu0FlTbYp3CqJu+9IFe9bLyAjMxf5ZDDbEg+iMPzB5zYyUTSm8wVTKmA== - dependencies: - p-locate "^2.0.0" - path-exists "^3.0.0" - locate-path@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/locate-path/-/locate-path-3.0.0.tgz#dbec3b3ab759758071b58fe59fc41871af21400e" @@ -17536,13 +17351,6 @@ own-keys@^1.0.1: object-keys "^1.1.1" safe-push-apply "^1.0.0" -p-limit@^1.1.0: - version "1.3.0" - resolved "https://registry.yarnpkg.com/p-limit/-/p-limit-1.3.0.tgz#b86bd5f0c25690911c7590fcbfc2010d54b3ccb8" - integrity sha512-vvcXsLAJ9Dr5rQOPk7toZQZJApBl2K4J6dANSsEuh6QI41JYcsS/qhTGa9ErIUUgK3WNQoJYvylxvjqmiqEA9Q== - dependencies: - p-try "^1.0.0" - p-limit@^2.0.0, p-limit@^2.2.0: version "2.3.0" resolved "https://registry.yarnpkg.com/p-limit/-/p-limit-2.3.0.tgz#3dd33c647a214fdfffd835933eb086da0dc21db1" @@ -17564,13 +17372,6 @@ p-limit@^4.0.0: dependencies: yocto-queue "^1.0.0" -p-locate@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/p-locate/-/p-locate-2.0.0.tgz#20a0103b222a70c8fd39cc2e580680f3dde5ec43" - integrity sha512-nQja7m7gSKuewoVRen45CtVfODR3crN3goVQ0DDZ9N3yHxgpkuBhZqsaiotSQRrADUrne346peY7kT3TSACykg== - dependencies: - p-limit "^1.1.0" - p-locate@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/p-locate/-/p-locate-3.0.0.tgz#322d69a05c0264b25997d9f40cd8a891ab0064a4" @@ -17606,11 +17407,6 @@ p-map@^4.0.0: dependencies: aggregate-error "^3.0.0" -p-try@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/p-try/-/p-try-1.0.0.tgz#cbc79cdbaf8fd4228e13f621f2b1a237c1b207b3" - integrity sha512-U1etNYuMJoIz3ZXSrrySFjsXQTWOx2/jdi86L+2pRvph/qMKL6sbcCYdH23fqsbm8TH2Gn0OybpT4eSFlCVHww== - p-try@^2.0.0: version "2.2.0" resolved "https://registry.yarnpkg.com/p-try/-/p-try-2.2.0.tgz#cb2868540e313d61de58fafbe35ce9004d5540e6" @@ -17917,11 +17713,6 @@ pidtree@^0.3.0: resolved "https://registry.yarnpkg.com/pidtree/-/pidtree-0.3.1.tgz#ef09ac2cc0533df1f3250ccf2c4d366b0d12114a" integrity sha512-qQbW94hLHEqCg7nhby4yRC7G2+jYHY4Rguc2bjw7Uug4GIJuu1tvf2uHaZv5Q8zdt+WKJ6qK1FOI6amaWUo5FA== -pify@^2.3.0: - version "2.3.0" - resolved "https://registry.yarnpkg.com/pify/-/pify-2.3.0.tgz#ed141a6ac043a849ea588498e7dca8b15330e90c" - integrity sha512-udgsAY+fTnvv7kI7aaxbqwWNb0AHiB0qBO89PZKPkoTmGOgdbrHDKD+0B2X4uTfJ/FT1R09r9gTsjUjNJotuog== - pify@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/pify/-/pify-3.0.0.tgz#e5a4acd2c101fdf3d9a4d07f0dbc4db49dd28176" @@ -18833,14 +18624,6 @@ reactcss@^1.2.0: dependencies: lodash "^4.0.1" -read-pkg-up@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/read-pkg-up/-/read-pkg-up-3.0.0.tgz#3ed496685dba0f8fe118d0691dc51f4a1ff96f07" - integrity sha512-YFzFrVvpC6frF1sz8psoHDBGF7fLPc+llq/8NB43oagqWkx8ar5zYtsTORtOjw9W2RHLpWP+zTWwBvf1bCmcSw== - dependencies: - find-up "^2.0.0" - read-pkg "^3.0.0" - read-pkg-up@^7.0.1: version "7.0.1" resolved "https://registry.yarnpkg.com/read-pkg-up/-/read-pkg-up-7.0.1.tgz#f3a6135758459733ae2b95638056e1854e7ef507" @@ -19969,13 +19752,6 @@ split2@^4.0.0: resolved "https://registry.yarnpkg.com/split2/-/split2-4.2.0.tgz#c9c5920904d148bab0b9f67145f245a86aadbfa4" integrity sha512-UcjcJOWknrNkF6PLX83qcHM6KHgVKNkV62Y8a5uYDVv9ydGQVwAHMKqHdJje1VTWpljG0WYpCDhrCdAOYH4TWg== -split@^1.0.0: - version "1.0.1" - resolved "https://registry.yarnpkg.com/split/-/split-1.0.1.tgz#605bd9be303aa59fb35f9229fbea0ddec9ea07d9" - integrity sha512-mTyOoPbrivtXnwnIxZRFYRrPNtEFKlpB2fvjSnCQUiAA6qAZzqwna5envK4uk6OIeP17CsdF3rSBGYVBsU0Tkg== - dependencies: - through "2" - sprintf-js@^1.1.3: version "1.1.3" resolved "https://registry.yarnpkg.com/sprintf-js/-/sprintf-js-1.1.3.tgz#4914b903a2f8b685d17fdf78a70e917e872e444a" @@ -20412,14 +20188,6 @@ temp@^0.8.4: dependencies: rimraf "~2.6.2" -tempfile@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/tempfile/-/tempfile-3.0.0.tgz#5376a3492de7c54150d0cc0612c3f00e2cdaf76c" - integrity sha512-uNFCg478XovRi85iD42egu+eSFUmmka750Jy7L5tfHI5hQKKtbPnxaSaXAbBqCDYrw3wx4tXjKwci4/QmsZJxw== - dependencies: - temp-dir "^2.0.0" - uuid "^3.3.2" - tempy@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/tempy/-/tempy-1.0.1.tgz#30fe901fd869cfb36ee2bd999805aa72fbb035de" @@ -20509,7 +20277,7 @@ thread-stream@^0.15.1: dependencies: real-require "^0.1.0" -through2@^2.0.0, through2@^2.0.3: +through2@^2.0.3: version "2.0.5" resolved "https://registry.yarnpkg.com/through2/-/through2-2.0.5.tgz#01c1e39eb31d07cb7d03a96a70823260b23132cd" integrity sha512-/mrRod8xqpA+IHSLyGCQ2s8SPHiCDEeQJSep1jqLYeEUClOFG2Qsh+4FU6G9VeqpZnGW/Su8LQGc4YKni5rYSQ== @@ -20524,7 +20292,7 @@ through2@^4.0.0: dependencies: readable-stream "3" -through@2, "through@>=2.2.7 <3", through@^2.3.4, through@^2.3.6: +"through@>=2.2.7 <3", through@^2.3.4, through@^2.3.6: version "2.3.8" resolved "https://registry.yarnpkg.com/through/-/through-2.3.8.tgz#0dd4c9ffaabc357960b1b724115d7e0e86a2e1f5" integrity sha512-w89qg7PI8wAdvX60bMDP+bFoD5Dvhm9oLheFp5O4a2QF0cSBGsBX4qZmadPMvVqlLJBBci+WqGGOAPvcDeNSVg== @@ -21245,11 +21013,6 @@ uuid-random@^1.3.2: resolved "https://registry.yarnpkg.com/uuid-random/-/uuid-random-1.3.2.tgz#96715edbaef4e84b1dcf5024b00d16f30220e2d0" integrity sha512-UOzej0Le/UgkbWEO8flm+0y+G+ljUon1QWTEZOq1rnMAsxo2+SckbiZdKzAHHlVh6gJqI1TjC/xwgR50MuCrBQ== -uuid@^3.3.2: - version "3.4.0" - resolved "https://registry.yarnpkg.com/uuid/-/uuid-3.4.0.tgz#b23e4358afa8a202fe7a100af1f5f883f02007ee" - integrity sha512-HjSDRw6gZE5JMggctHBcjVak08+KEVhSIiDzFnT9S9aegmp85S/bReBVTb4QTFaRNptJ9kuYaNhnbNEOkbKb/A== - uuid@^8.3.2: version "8.3.2" resolved "https://registry.yarnpkg.com/uuid/-/uuid-8.3.2.tgz#80d5b5ced271bb9af6c445f21a1a04c606cefbe2" @@ -22048,7 +21811,7 @@ yargs-parser@^18.1.2: camelcase "^5.0.0" decamelize "^1.2.0" -yargs-parser@^20.2.2, yargs-parser@^20.2.3: +yargs-parser@^20.2.3: version "20.2.9" resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-20.2.9.tgz#2eb7dc3b0289718fc295f362753845c41a0c94ee" integrity sha512-y11nGElTIV+CT3Zv9t7VKl+Q3hTQoT9a1Qzezhhl6Rp21gJ/IVTW7Z3y9EWXhuUBC2Shnf+DX0antecpAwSP8w== @@ -22070,19 +21833,6 @@ yargs@^15.3.1: y18n "^4.0.0" yargs-parser "^18.1.2" -yargs@^16.2.0: - version "16.2.0" - resolved "https://registry.yarnpkg.com/yargs/-/yargs-16.2.0.tgz#1c82bf0f6b6a66eafce7ef30e376f49a12477f66" - integrity sha512-D1mvvtDG0L5ft/jGWkLpG1+m0eQxOfaBvTNELraWj22wSVUMWxZUvYgJYcKh6jGGIkJFhH4IZPQhR4TKpc8mBw== - dependencies: - cliui "^7.0.2" - escalade "^3.1.1" - get-caller-file "^2.0.5" - require-directory "^2.1.1" - string-width "^4.2.0" - y18n "^5.0.5" - yargs-parser "^20.2.2" - yargs@^17.0.0, yargs@^17.6.2: version "17.7.2" resolved "https://registry.yarnpkg.com/yargs/-/yargs-17.7.2.tgz#991df39aca675a192b816e1e0363f9d75d2aa269" From ef80860ea28c235d1032309724d2b3ea8ff0a652 Mon Sep 17 00:00:00 2001 From: arlert-armin Date: Mon, 4 Aug 2025 22:44:36 +0000 Subject: [PATCH 5/8] fix: return promise for generate changelog --- scripts/changelog/command.mjs | 4 ++-- scripts/common/changelog.mjs | 16 +++++++++++----- scripts/publish/publish.mjs | 2 +- 3 files changed, 14 insertions(+), 8 deletions(-) diff --git a/scripts/changelog/command.mjs b/scripts/changelog/command.mjs index bdf46bfe19..8d872b1b93 100644 --- a/scripts/changelog/command.mjs +++ b/scripts/changelog/command.mjs @@ -20,7 +20,7 @@ async function generateChangelogForRoot(options) { console.log('commits:', commitsCount); if (options.save) { - generateChangelogAndSave(); + await generateChangelogAndSave(); } else { generateChangelogAndPrint(); } @@ -39,7 +39,7 @@ async function generateChangelogForWorkspaceMembers(pkgs) { console.log('commits:', commitsCount); if (save) { - generateChangelogAndSave(pkg); + await generateChangelogAndSave(pkg); } else { generateChangelogAndPrint(pkg); } diff --git a/scripts/common/changelog.mjs b/scripts/common/changelog.mjs index 9bafb60dc9..1ee1c8eb1d 100644 --- a/scripts/common/changelog.mjs +++ b/scripts/common/changelog.mjs @@ -133,12 +133,18 @@ export function generateChangelog(pkg) { * * @param {import("./typedefs.mjs").Package} [pkg] */ -export function generateChangelogAndSave(pkg) { - const changelog = generateChangelog(pkg); +export async function generateChangelogAndSave(pkg) { + return new Promise((resolve, reject) => { + const changelog = generateChangelog(pkg); + + // we only need location for file stream, when pkg is undefined, we will point to root package.json + if (!pkg) pkg = { location: rootPath() }; - // we only need location for file stream, when pkg is undefined, we will point to root package.json - if (!pkg) pkg = { location: rootPath() }; - changelog.pipe(changelogFileStream(pkg)); + const writeStream = changelog.pipe(changelogFileStream(pkg)); + + writeStream.on('finish', resolve); + writeStream.on('error', reject); + }); } /** diff --git a/scripts/publish/publish.mjs b/scripts/publish/publish.mjs index fd3177850d..8cd671bd57 100644 --- a/scripts/publish/publish.mjs +++ b/scripts/publish/publish.mjs @@ -41,7 +41,7 @@ async function publishTask(pkg, { onUpdateState }) { if (should('generateChangelog')) { console.log(chalk.green('[2/4]'), `Making changelog`); - generateChangelogAndSave(pkg); + await generateChangelogAndSave(pkg); } else { console.log(chalk.green('[2/4]'), `Skipping changelog and github release.`); } From 670fcd766c5bf6174bcb6ec17091716c423bab58 Mon Sep 17 00:00:00 2001 From: arlert-armin Date: Tue, 12 Aug 2025 10:38:46 +0000 Subject: [PATCH 6/8] chore: modify publish to generate root changelog --- scripts/common/constants.mjs | 1 + scripts/deploy/config.mjs | 8 ++-- scripts/publish/command.mjs | 14 ++++-- scripts/publish/version-log.mjs | 81 +++++++++++++++++++++++++++++++++ 4 files changed, 96 insertions(+), 8 deletions(-) create mode 100644 scripts/publish/version-log.mjs diff --git a/scripts/common/constants.mjs b/scripts/common/constants.mjs index 4c35e09889..7e0ba482d0 100644 --- a/scripts/common/constants.mjs +++ b/scripts/common/constants.mjs @@ -2,3 +2,4 @@ export const PUBLISH_COMMIT_SUBJECT = 'chore(release): publish'; export const NPM_ORG_NAME = '@rango-dev'; export const BUILD_META_FILE_SUFFIX = '.build.json'; +export const ROOT_VERSIONS_COMMIT_SUBJECT = 'chore(release): root versions and changelog'; diff --git a/scripts/deploy/config.mjs b/scripts/deploy/config.mjs index 450d35d042..5e787a5d26 100644 --- a/scripts/deploy/config.mjs +++ b/scripts/deploy/config.mjs @@ -5,13 +5,13 @@ const scope = `@rango-dev`; export const VERCEL_ORG_ID = process.env.VERCEL_ORG_ID; export const VERCEL_TOKEN = process.env.VERCEL_TOKEN; export const ENABLE_PREVIEW_DEPLOY = process.env.ENABLE_PREVIEW_DEPLOY; +export const WIDGET_APP_PACKAGE_NAME = `${scope}/widget-app`; +export const PLAYGROUND_PACKAGE_NAME = `${scope}/widget-playground`; export const EXCLUDED_PACKAGES = ['@rango-dev/widget-iframe']; export const VERCEL_PACKAGES = { [`${scope}/queue-manager-demo`]: getEnvWithFallback('VERCEL_PROJECT_Q'), - [`${scope}/widget-playground`]: getEnvWithFallback( - 'VERCEL_PROJECT_WIDGET_CONFIG' - ), - [`${scope}/widget-app`]: getEnvWithFallback('VERCEL_PROJECT_WIDGET_APP'), + [PLAYGROUND_PACKAGE_NAME]: getEnvWithFallback('VERCEL_PROJECT_WIDGET_CONFIG'), + [WIDGET_APP_PACKAGE_NAME]: getEnvWithFallback('VERCEL_PROJECT_WIDGET_APP'), [`${scope}/storybook`]: getEnvWithFallback('VERCEL_PROJECT_STORYBOOK'), }; diff --git a/scripts/publish/command.mjs b/scripts/publish/command.mjs index f8739b6bde..28d3b7091e 100755 --- a/scripts/publish/command.mjs +++ b/scripts/publish/command.mjs @@ -16,6 +16,7 @@ import { addFileToStage, publishCommitAndTags, push } from '../common/git.mjs'; import { update } from './package.mjs'; import { build } from './build.mjs'; import { should } from '../common/features.mjs'; +import { versionLog } from './version-log.mjs'; async function run() { logAsSection('::group::🔍 Checking environments...'); @@ -63,7 +64,12 @@ async function run() { console.log('::endgroup::'); - // 2. Build all packacges + // 2. Generate root changelog and bump widget, app and root versions. + logAsSection('::group::📋 Root changelog and versions...'); + await versionLog(); + console.log('::endgroup::'); + + // 3. Build all packacges /** * IMPORTANT NOTE: * We are all the libs in parallel, parcel has a limitation on running `parcel` instances. @@ -76,7 +82,7 @@ async function run() { await build(pkgs); console.log('::endgroup::'); - // 3. Publish + // 4. Publish logAsSection(`::group::🚀 Start publishing...`); try { await tryPublish(pkgs, { @@ -100,7 +106,7 @@ async function run() { console.log('::endgroup::'); - // 4. Tag and Push + // 5. Tag and Push /** * Our final list will includes only packages that published on NPM. @@ -145,7 +151,7 @@ async function run() { console.log('::endgroup::'); - // 5. Making github release + // 6. Making github release // NOTE: If any error happens in this step we are don't bail out the process and will continue. A warning will be shown. console.log('::group::🐙 Github release'); if (should('generateChangelog')) { diff --git a/scripts/publish/version-log.mjs b/scripts/publish/version-log.mjs new file mode 100644 index 0000000000..bddeb8ebf3 --- /dev/null +++ b/scripts/publish/version-log.mjs @@ -0,0 +1,81 @@ +import { generateChangelogAndSave } from '../common/changelog.mjs'; +import path from 'node:path'; +import chalk from 'chalk'; +import { should } from '../common/features.mjs'; +import { addFileToStage } from '../common/git.mjs'; +import { ROOT_VERSIONS_COMMIT_SUBJECT } from '../common/constants.mjs'; +import { execa } from 'execa'; +import { GitError } from '../common/errors.mjs'; +import { + PLAYGROUND_PACKAGE_NAME, + WIDGET_APP_PACKAGE_NAME, +} from '../deploy/config.mjs'; +function rootPath() { + return path.join('.'); +} +function rootChangelogPath() { + return path.join(rootPath(), 'CHANGELOG.md'); +} +function rootPackageJsonPath() { + return path.join(rootPath(), 'package.json'); +} +function widgetAppPackageJsonPath() { + return path.join(rootPath(), 'widget', 'app', 'package.json'); +} +function playgroundPackageJsonPath() { + return path.join(rootPath(), 'widget', 'playground', 'package.json'); +} +async function generateRootChangelog() { + console.log(`Making root changelog...`); + await generateChangelogAndSave(); + await addFileToStage(rootChangelogPath()); +} +async function commitChanges() { + const message = `${ROOT_VERSIONS_COMMIT_SUBJECT}`; + const body = '[skip ci]'; + + console.log(`Committing root changelog...`); + // Making a deploy commit + await execa('git', ['commit', '-m', message, '-m', body]).catch((error) => { + throw new GitError(`git commit failed. \n ${error.stderr}`); + }); +} +async function bumpVersions() { + await bumpRootVersion(); + await addFileToStage(rootPackageJsonPath()); + await bumpPackageVersion(WIDGET_APP_PACKAGE_NAME); + await addFileToStage(widgetAppPackageJsonPath()); + await bumpPackageVersion(PLAYGROUND_PACKAGE_NAME); + await addFileToStage(playgroundPackageJsonPath()); +} +async function bumpRootVersion() { + return await execa('yarn', [ + 'version', + `--major`, + '--no-git-tag-version', + '--json', + ]); +} +async function bumpPackageVersion(pkg) { + return await execa('yarn', [ + 'workspace', + pkg, + 'version', + `--minor`, + '--no-git-tag-version', + '--json', + ]); +} +export async function versionLog() { + if (should('generateChangelog')) { + console.log(chalk.green('[1/3]'), `Bump versions`); + await bumpVersions(); + console.log(chalk.green('[2/3]'), `Generate root changelog`); + await generateRootChangelog(); + + console.log(chalk.green('[3/3]'), `Commit changes`); + await commitChanges(); + } else { + console.log('Skipping root changelog and versioning...'); + } +} \ No newline at end of file From 681599a85b02a8b4b83de4dff07f80ebda476947 Mon Sep 17 00:00:00 2001 From: arlert-armin Date: Mon, 4 Aug 2025 09:07:07 +0000 Subject: [PATCH 7/8] chore: add post-release workflow --- .github/workflows/postrelease.yml | 21 +++++++++++++++++++++ .github/workflows/prerelease.yml | 2 +- docs/release.md | 4 +--- scripts/common/git.mjs | 11 +++++++++-- scripts/post-release/command.mjs | 10 ++++++---- 5 files changed, 38 insertions(+), 10 deletions(-) create mode 100644 .github/workflows/postrelease.yml diff --git a/.github/workflows/postrelease.yml b/.github/workflows/postrelease.yml new file mode 100644 index 0000000000..f293481cb3 --- /dev/null +++ b/.github/workflows/postrelease.yml @@ -0,0 +1,21 @@ +name: Post-Release +on: + workflow_dispatch: + +jobs: + post-release: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + with: + fetch-depth: 0 + token: ${{ secrets.PAT }} + + - name: Prepare + uses: ./.github/actions/prepare + + - name: Post Release + run: yarn run post-release-prod + env: + REF: ${{ github.ref }} + GH_TOKEN: ${{ github.token }} diff --git a/.github/workflows/prerelease.yml b/.github/workflows/prerelease.yml index 87c1837d9c..73995d0da2 100644 --- a/.github/workflows/prerelease.yml +++ b/.github/workflows/prerelease.yml @@ -1,4 +1,4 @@ -name: Prerelease +name: Pre-Release on: workflow_dispatch: diff --git a/docs/release.md b/docs/release.md index 49f939db38..5069cfe05b 100644 --- a/docs/release.md +++ b/docs/release.md @@ -87,9 +87,7 @@ git commit -m "chore(release): deploy" -m "[skip ci]" #### 4. Promote our clients (widget and playground) to production on Vercel (ask the team if you don't have access). -#### 5. Create a pull request from the `main` branch to `next` to update the `next` branch. - -Please keep in mind that this PR should be merged using the `Create a merge commit` strategy instead of the default `Rebase and merge` strategy. +#### 5. Run the Post-Release workflow, which will merge the `main` branch into the `next` branch to keep it in sync. **NOTE 1:** diff --git a/scripts/common/git.mjs b/scripts/common/git.mjs index e68bd3e05f..473fc2d4a7 100644 --- a/scripts/common/git.mjs +++ b/scripts/common/git.mjs @@ -251,8 +251,15 @@ export async function checkout(branch) { } export async function merge(branch, mergeOptions) { - const { mergeStrategy = '' } = mergeOptions; - const output = await execa('git', ['merge', mergeStrategy, branch]) + const { mergeStrategy = '', messages = [] } = mergeOptions; + const messagesWithSwitch = messages.flatMap((message) => ['-m', message]); + + const output = await execa('git', [ + 'merge', + mergeStrategy, + branch, + ...messagesWithSwitch, + ]) .then(({ stdout }) => stdout) .catch((error) => { throw new GitError(`git merge failed. \n ${error.stderr}`); diff --git a/scripts/post-release/command.mjs b/scripts/post-release/command.mjs index ef286290fd..603c4f8113 100644 --- a/scripts/post-release/command.mjs +++ b/scripts/post-release/command.mjs @@ -1,17 +1,19 @@ import { checkout, merge, pull, push } from '../common/git.mjs'; -import { checkCommitAndGetPkgs } from './tag.mjs'; async function run() { // Make sure we are on main and having latest changes await checkout('main'); await pull(); - await checkCommitAndGetPkgs(); - // Merge phase await checkout('next'); await pull(); - await merge('main', { mergeStrategy: '--no-ff' }); + + await merge('main', { + mergeStrategy: '--no-ff', + messages: ['chore: sync next with main', '[skip ci]'], + }); + await push(); } From 65415cacb6c94837baac07a4c1dcb9a7898f1c5b Mon Sep 17 00:00:00 2001 From: arlert-armin Date: Wed, 13 Aug 2025 10:47:55 +0000 Subject: [PATCH 8/8] chore: implement auto release chain --- .github/workflows/deploy.yml | 33 ++- .../workflows/{release.yml => main-sync.yml} | 16 +- .github/workflows/post-release.yml | 35 +++ .github/workflows/postrelease.yml | 21 -- .github/workflows/publish.yml | 18 +- .github/workflows/release-prod.yml | 44 ++++ docs/release.md | 210 +++++++++++++----- package.json | 2 +- scripts/{release => main-sync}/command.mjs | 5 +- scripts/post-release/command.mjs | 2 +- 10 files changed, 299 insertions(+), 87 deletions(-) rename .github/workflows/{release.yml => main-sync.yml} (65%) create mode 100644 .github/workflows/post-release.yml delete mode 100644 .github/workflows/postrelease.yml create mode 100644 .github/workflows/release-prod.yml rename scripts/{release => main-sync}/command.mjs (85%) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 811d7c18a4..e164de6ab5 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -2,14 +2,45 @@ name: Deploy on: workflow_dispatch: + workflow_call: + secrets: + PAT: + description: 'Add a PAT to secrets.' + required: true + VERCEL_ORG_ID: + description: 'Add a VERCEL_ORG_ID to secrets.' + required: true + VERCEL_TOKEN: + description: 'Add a VERCEL_TOKEN to secrets.' + required: true + VERCEL_PROJECT_WIDGET_CONFIG: + description: 'Add a VERCEL_PROJECT_WIDGET_CONFIG to secrets.' + required: true + VERCEL_PROJECT_WIDGET_APP: + description: 'Add a VERCEL_PROJECT_WIDGET_APP to secrets.' + required: true + VERCEL_PROJECT_STORYBOOK: + description: 'Add a VERCEL_PROJECT_STORYBOOK to secrets.' + required: true + VERCEL_PROJECT_Q: + description: 'Add a VERCEL_PROJECT_Q to secrets.' + required: true + inputs: + branch: + description: 'Branch to checkout' + required: true + type: string jobs: deploy-it: runs-on: ubuntu-latest + env: + TARGET_BRANCH: ${{ inputs.branch || github.ref }} steps: - uses: actions/checkout@v4 with: fetch-depth: 0 token: ${{ secrets.PAT }} + ref: ${{ env.TARGET_BRANCH }} - name: Prepare uses: ./.github/actions/prepare @@ -19,7 +50,7 @@ jobs: yarn global add vercel yarn run deploy env: - REF: ${{ github.ref }} + REF: ${{ env.TARGET_BRANCH }} GH_TOKEN: ${{ github.token }} VERCEL_ORG_ID: ${{ secrets.VERCEL_ORG_ID }} VERCEL_TOKEN: ${{ secrets.VERCEL_TOKEN }} diff --git a/.github/workflows/release.yml b/.github/workflows/main-sync.yml similarity index 65% rename from .github/workflows/release.yml rename to .github/workflows/main-sync.yml index e44b055384..4691e1b909 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/main-sync.yml @@ -1,9 +1,17 @@ -name: Release +name: Main Sync on: workflow_dispatch: + workflow_call: + secrets: + NPM_TOKEN: + description: 'You need a npm token to be set.' + required: true + PAT: + description: 'Add a PAT to secrets.' + required: true jobs: - release: + main-sync: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 @@ -14,8 +22,8 @@ jobs: - name: Prepare uses: ./.github/actions/prepare - - name: Release Production - run: yarn run release-prod + - name: Sync main to the next + run: yarn run main-sync env: REF: ${{ github.ref }} GH_TOKEN: ${{ github.token }} diff --git a/.github/workflows/post-release.yml b/.github/workflows/post-release.yml new file mode 100644 index 0000000000..6e2883495c --- /dev/null +++ b/.github/workflows/post-release.yml @@ -0,0 +1,35 @@ +name: Post-Release +on: + workflow_dispatch: + + + workflow_call: + secrets: + PAT: + description: 'Add a PAT to secrets.' + required: true + inputs: + branch: + description: 'Branch to checkout' + required: true + type: string +jobs: + post-release: + runs-on: ubuntu-latest + env: + TARGET_BRANCH: ${{ inputs.branch || github.ref }} + steps: + - uses: actions/checkout@v4 + with: + fetch-depth: 0 + token: ${{ secrets.PAT }} + ref: ${{ env.TARGET_BRANCH }} + + - name: Prepare + uses: ./.github/actions/prepare + + - name: Post Release + run: yarn run post-release-prod + env: + REF: ${{ env.TARGET_BRANCH }} + GH_TOKEN: ${{ github.token }} \ No newline at end of file diff --git a/.github/workflows/postrelease.yml b/.github/workflows/postrelease.yml deleted file mode 100644 index f293481cb3..0000000000 --- a/.github/workflows/postrelease.yml +++ /dev/null @@ -1,21 +0,0 @@ -name: Post-Release -on: - workflow_dispatch: - -jobs: - post-release: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - with: - fetch-depth: 0 - token: ${{ secrets.PAT }} - - - name: Prepare - uses: ./.github/actions/prepare - - - name: Post Release - run: yarn run post-release-prod - env: - REF: ${{ github.ref }} - GH_TOKEN: ${{ github.token }} diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 9ee0fe9c49..0ea0208b14 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -4,7 +4,21 @@ on: branches: - 'main' - 'next' + workflow_dispatch: + workflow_call: + secrets: + NPM_TOKEN: + description: 'You need a npm token to be set.' + required: true + PAT: + description: 'Add a PAT to secrets.' + required: true + inputs: + branch: + description: 'Branch to checkout' + required: true + type: string concurrency: group: package-publishing @@ -12,6 +26,8 @@ jobs: publish: timeout-minutes: 30 runs-on: ubuntu-latest + env: + TARGET_BRANCH: ${{ inputs.branch || github.ref }} steps: - uses: actions/checkout@v4 with: @@ -25,7 +41,7 @@ jobs: - name: Build, Version & Publish packages run: yarn run publish env: - REF: ${{ github.ref }} + REF: ${{ env.TARGET_BRANCH }} GH_TOKEN: ${{ github.token }} # Github will create .npmrc based on this env variable. # https://docs.github.com/en/actions/publishing-packages/publishing-nodejs-packages#publishing-packages-to-the-npm-registry diff --git a/.github/workflows/release-prod.yml b/.github/workflows/release-prod.yml new file mode 100644 index 0000000000..2818256d1d --- /dev/null +++ b/.github/workflows/release-prod.yml @@ -0,0 +1,44 @@ +name: Production Release +on: + workflow_dispatch: + +jobs: + main-sync: + uses: ./.github/workflows/main-sync.yml + secrets: + NPM_TOKEN: ${{ secrets.NPM_TOKEN }} + PAT: ${{ secrets.PAT }} + + publish: + needs: main-sync + uses: ./.github/workflows/publish.yml + with: + branch: + refs/heads/main + secrets: + NPM_TOKEN: ${{ secrets.NPM_TOKEN }} + PAT: ${{ secrets.PAT }} + + deploy: + needs: publish + uses: ./.github/workflows/deploy.yml + with: + branch: + refs/heads/main + secrets: + PAT: ${{ secrets.PAT }} + VERCEL_ORG_ID: ${{ secrets.VERCEL_ORG_ID }} + VERCEL_TOKEN: ${{ secrets.VERCEL_TOKEN }} + VERCEL_PROJECT_WIDGET_CONFIG: ${{ secrets.VERCEL_PROJECT_WIDGET_CONFIG }} + VERCEL_PROJECT_WIDGET_APP: ${{ secrets.VERCEL_PROJECT_WIDGET_APP }} + VERCEL_PROJECT_STORYBOOK: ${{ secrets.VERCEL_PROJECT_STORYBOOK }} + VERCEL_PROJECT_Q: ${{ secrets.VERCEL_PROJECT_Q }} + + post-release: + needs: deploy + with: + branch: + refs/heads/next + uses: ./.github/workflows/post-release.yml + secrets: + PAT: ${{ secrets.PAT }} \ No newline at end of file diff --git a/docs/release.md b/docs/release.md index 5069cfe05b..c07f4135e0 100644 --- a/docs/release.md +++ b/docs/release.md @@ -1,98 +1,194 @@ -# Release -## How we are releasing a new version? +# **Release Guide** -A release can be a lib or an app/client release. We are publishing our libs to `npm` and deploying our apps (client) on `vercel`. +## Overview -If a package is client, you need to add the package name to `scripts/deploy/config.mjs` and then after getting a `PROJECT_ID` from Vercel, you need to set it as environment variable as well. +A release can involve: -There are main commands: +* **Libraries** (published to `npm`) +* **Apps/Clients** (deployed to Vercel) -`yarn run publish` for publishing our NPM packages. -`yarn run deploy` to deploy apps on Vercel. +If a package is a client, ensure: -### Publish flow +* The package name is listed in `scripts/deploy/config.mjs`. +* You have a `PROJECT_ID` from Vercel set as an environment variable. -#### Publish +--- -Our publish script will do these steps: +## **Key Commands** -1. Get the last release (by using git tags) and calculate changes since then. -2. Bump the version for changed packages. -3. Create changelog, git tags and github release, and publish them to NPM. -4. Make a publish commit and push the updated packages (version) and tags to origin. +* `yarn run publish` → Publishes NPM packages. +* `yarn run deploy` → Deploys apps to Vercel. -Note: -Libs will be published under `next` tag on npm, which means you need to use `yarn add @rango/test-package@next` to install the published version whenever you need. +--- -#### Production release +## **Publish Flow** -There is a workflow called `Production Release`, you just need to run this workflow manually and then it will automatically published. +The `publish` script performs: -### Deploy flow +1. Gets the last release (via git tags) and calculates changes. +2. Bumps versions for changed packages. +3. Creates changelogs, git tags, and GitHub releases. +4. Publishes updated packages to NPM. +5. Pushes updated package versions and tags to origin. -You should manually trigger the `deploy` workflow. +**If run on `main` branch**, the publish script will also: -By running `yarn run deploy`, it will build all the apps/clients then will try to deploy them on vercel. +* Automatically bump `widget/app` and/or `widget/playground` versions if changed. +* Automatically update the root `CHANGELOG.md`. -If the workflow is running on `next` branch, it will be deployed as Vercel's `preview`. If not, it's production release. +**Note:** Libraries are published under the `next` tag on npm. To install them: -All the apps published by `prerelease` workflow will be published under the Vercel's `preview` environment. +```sh +yarn add @rango-dev/widget-embedded@next +``` -## How you can release a new version? +--- -### Next (Staging) +## **Deploy Flow** -A publish will be triggered when a **Pull Request** has been merged. +Running `yarn run deploy`: -### Production +* Builds all apps/clients. +* Deploys them to Vercel. -Follow these steps for the release: +**Branch behavior:** -#### 1. Run the `Production Release` workflow manually. +* On `next` → Deploys to Vercel **Preview** environment. +* On `main` → Deploys to **Production** environment. -For releasing production, you need to run `Production Release` workflow, it will pull the latest translation changes on `next` branch and checkout to `next` branch and pull the latest changes then it tries to merge the `next` into `main` by `--no-ff` strategy, To make sure that a new commit is made And previous commits that may have `[skips ci]` Do not prevent workflow from triggering. +--- -#### 2. When workflow finished running, increase `widget/app` and `widget/playground` version and update changelog. +## **Release Types** -You should submit a pull request to the main branch from a new hotfix branch, incrementing the minor version by 1. Additionally, please remember to update the 'CHANGELOG.md' file located at the root of the repository. To do this you can follow the following steps: +### **Next (Staging)** -1. If widget has any updates: +A publish to **Preview** is triggered automatically when a Pull Request is merged into `next`. -```shell -cd widget/app -yarn version --minor --no-git-tag-version -``` +--- -2. if playground has any changes: +### **Production** -```shell -cd widget/playground -yarn version --minor --no-git-tag-version -``` +We now have **two ways** to release production: -3. Then you need to update `/CHANGELOG.md` (root) and list all the changes into widget or playground. you can use the template at the end of list. _Don't forget to use correct date and version (that you've ran before)._ +--- -4. Finally, you can commit your changes, run the following commands from workspace's root: +#### **Option 1 — Automatic (Recommended)** -```shell -git add CHANGELOG.md -git add widget/app/package.json -git add widget/playground/package.json +Run the **`Production Release`** workflow. +It will: -git commit -m "chore(release): deploy" -m "[skip ci]" -``` +1. **Sync `main` with `next`** + + * Pull latest translations on `next`. + * Merge `next` into `main` using `--no-ff`. + +2. **Publish** *(on `main`)* + + * Automatically bump `widget/app` and/or `widget/playground` versions if changed. + * Automatically update the root `CHANGELOG.md`. + * Publish to NPM. + +3. **Deploy** + + * Build and deploy apps to Vercel (Preview). + * **You must copy the deploy URLs from the logs.** + +4. **Promote** *(manual step)* + + * Promote the widget and playground deployments to **Production** in Vercel. + +5. **Post-Release** + + * Merge `main` back into `next` to keep branches in sync. + +**After finishing:** + +* Send a highlight note on Telegram [like this](https://t.me/c/1797229876/15255/23609). +* Update `widget-examples`: + + ```sh + yarn add @rango-dev/widget-embedded@latest + ``` -#### 3. Run the `Deploy` workflow if the publish was successful. + Open a PR to ensure all examples are on the latest version. -#### 4. Promote our clients (widget and playground) to production on Vercel (ask the team if you don't have access). +--- -#### 5. Run the Post-Release workflow, which will merge the `main` branch into the `next` branch to keep it in sync. +#### **Option 2 — Manual** -**NOTE 1:** +If you need more control or want to run steps separately: -Ensure you send a highlight note on Telegram [like this](https://t.me/c/1797229876/15255/23609) at the end. +1. **Run `Main Sync`** -**NOTE 2:** + * Pull latest translations on `next`. + * Merge `next` into `main` using `--no-ff`. + +2. **Run `Publish`** *(on `main`)* + + * Automatically bump `widget/app` and/or `widget/playground` versions if changed. + * Automatically update the root `CHANGELOG.md`. + * Publish to NPM. + * Deploy to Vercel (Preview). + +3. **Promote** *(manual step)* + + * Copy deploy URLs from logs. + * Promote widget and playground to **Production** in Vercel. + +4. **Run `Post-Release`** + + * Merge `main` back into `next`. + +5. **After finishing** + + * Send Telegram highlight note. + * Update `widget-examples` as in automatic flow. + +--- + +## **Visual Diagram** + +``` + ┌─────────────────────┐ + │ Automatic Flow │ + └─────────────────────┘ + │ + Run "Production Release" + │ + ▼ + ┌─────────────────────────────────────────────┐ + │ 1. Sync main ← next │ + │ 2. Publish (bump + changelog + NPM publish) │ + │ 3. Deploy (Preview) │ + │ 4. Promote to Production (manual) │ + │ 5. Post-Release (main → next) │ + └─────────────────────────────────────────────┘ + │ + ▼ + Send Telegram note + update widget-examples +``` + +``` + ┌───────────────────┐ + │ Manual Flow │ + └───────────────────┘ + │ + Run "Main Sync" manually + │ + ▼ + Run "Publish" on main + │ + ▼ + Deploy (Preview) + │ + ▼ + Promote to Production in Vercel (manual) + │ + ▼ + Run "Post-Release" manually + │ + ▼ + Send Telegram note + update widget-examples +``` -Ensure you update widget-examples using `yarn add @rango-dev/widget-embedded@latest`. Then open a new PR on the repo to ensure all examples are on the latest version. diff --git a/package.json b/package.json index ee82f4d68a..f1a532fc1a 100644 --- a/package.json +++ b/package.json @@ -44,7 +44,7 @@ "format": "nx run-many --target=format", "publish": "node ./scripts/publish/command.mjs", "deploy": "node ./scripts/deploy/command.mjs", - "release-prod": "node ./scripts/release/command.mjs", + "main-sync": "node ./scripts/main-sync/command.mjs", "post-release-prod": "node ./scripts/post-release/command.mjs", "upgrade-all": "node ./scripts/upgrade-all/command.mjs --project ", "i18n:extract": "lingui extract --clean", diff --git a/scripts/release/command.mjs b/scripts/main-sync/command.mjs similarity index 85% rename from scripts/release/command.mjs rename to scripts/main-sync/command.mjs index 42dc6135e9..6e3757c6e7 100644 --- a/scripts/release/command.mjs +++ b/scripts/main-sync/command.mjs @@ -18,7 +18,10 @@ async function run() { console.log(`Result for: pull\n`, pullOutput); // Merge `next` into `main` - const mergeOutput = await merge('next',{ mergeStrategy: '--no-ff' }); + const mergeOutput = await merge('next', { + mergeStrategy: '--no-ff', + messages: ['chore(release): sync main with next', '[skip ci]'], + }); console.log(`Result for: merge\n`, mergeOutput); // Push merged commits to `main` diff --git a/scripts/post-release/command.mjs b/scripts/post-release/command.mjs index 603c4f8113..c982c6f32d 100644 --- a/scripts/post-release/command.mjs +++ b/scripts/post-release/command.mjs @@ -11,7 +11,7 @@ async function run() { await merge('main', { mergeStrategy: '--no-ff', - messages: ['chore: sync next with main', '[skip ci]'], + messages: ['chore(release): sync next with main', '[skip ci]'], }); await push();