diff --git a/.changeset/silly-stingrays-play.md b/.changeset/silly-stingrays-play.md new file mode 100644 index 000000000000..c5702ee55017 --- /dev/null +++ b/.changeset/silly-stingrays-play.md @@ -0,0 +1,5 @@ +--- +'@rocket.chat/meteor': patch +--- + +fix: Frontend crash if IndexedDB is not available, i.e. in Firefox private mode diff --git a/.changeset/tiny-cups-pump.md b/.changeset/tiny-cups-pump.md new file mode 100644 index 000000000000..4dcfeba8c638 --- /dev/null +++ b/.changeset/tiny-cups-pump.md @@ -0,0 +1,5 @@ +--- +'@rocket.chat/release-action': major +--- + +New action to publish package releases diff --git a/.github/workflows/new-release.yml b/.github/workflows/new-release.yml new file mode 100644 index 000000000000..f5869aa323c7 --- /dev/null +++ b/.github/workflows/new-release.yml @@ -0,0 +1,71 @@ +name: Start new release + +on: + workflow_dispatch: + inputs: + name: + type: choice + description: Release type + default: next + required: true + options: + - next + - patch + - publish + base-ref: + description: Base version + default: master + required: false + +env: + HUSKY: 0 + +jobs: + new-release: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v3 + with: + fetch-depth: 0 + + - name: Setup NodeJS + uses: ./.github/actions/setup-node + with: + node-version: 14.21.3 + cache-modules: true + install: true + + - uses: dtinth/setup-github-actions-caching-for-turbo@v1 + + - name: Build + run: yarn build + + - name: Start next release + if: ${{ github.event.inputs.name == 'next' }} + uses: ./packages/release-action + with: + action: bump + env: + NPM_TOKEN: ${{ secrets.NPM_TOKEN }} + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + + - name: Start patch release + if: ${{ github.event.inputs.name == 'patch' }} + uses: ./packages/release-action + with: + action: patch + base-ref: ${{ github.event.inputs.base-ref }} + env: + NPM_TOKEN: ${{ secrets.NPM_TOKEN }} + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + + - name: Publish release + if: ${{ github.event.inputs.name == 'publish' }} + uses: ./packages/release-action + with: + action: publish + base-ref: ${{ github.event.inputs.base-ref }} + env: + NPM_TOKEN: ${{ secrets.NPM_TOKEN }} + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/publish-release.yml b/.github/workflows/publish-release.yml new file mode 100644 index 000000000000..bb56beb975b9 --- /dev/null +++ b/.github/workflows/publish-release.yml @@ -0,0 +1,39 @@ +name: Publish Final Release + +on: + push: + branches: + - master + +concurrency: ${{ github.workflow }}-${{ github.ref }} + +env: + HUSKY: 0 + +jobs: + release: + name: Release + runs-on: ubuntu-latest + steps: + - name: Checkout Repo + uses: actions/checkout@v3 + + - name: Setup NodeJS + uses: ./.github/actions/setup-node + with: + node-version: 14.21.3 + cache-modules: true + install: true + + - uses: dtinth/setup-github-actions-caching-for-turbo@v1 + + - name: Build + run: yarn build + + - name: Publish final release + uses: ./packages/release-action + with: + action: publish-final + env: + NPM_TOKEN: ${{ secrets.NPM_TOKEN }} + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/apps/meteor/app/ui-cached-collection/client/models/CachedCollection.ts b/apps/meteor/app/ui-cached-collection/client/models/CachedCollection.ts index 6e5720131a9f..209451354434 100644 --- a/apps/meteor/app/ui-cached-collection/client/models/CachedCollection.ts +++ b/apps/meteor/app/ui-cached-collection/client/models/CachedCollection.ts @@ -92,7 +92,7 @@ export class CachedCollection extends Emitter<{ changed } private async loadFromCache() { - const data = await localforage.getItem<{ version: number; token: unknown; records: unknown[]; updatedAt: Date }>(this.name); + const data = await localforage.getItem<{ version: number; token: unknown; records: unknown[]; updatedAt: Date | string }>(this.name); if (!data) { return false; @@ -106,6 +106,11 @@ export class CachedCollection extends Emitter<{ changed return false; } + // updatedAt may be a Date or a string depending on the used localForage backend + if (!(data.updatedAt instanceof Date)) { + data.updatedAt = new Date(data.updatedAt); + } + if (Date.now() - data.updatedAt.getTime() >= 1000 * CachedCollection.MAX_CACHE_TIME) { return false; } diff --git a/package.json b/package.json index 48d563a0f17b..0aac7e78b6aa 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "rocket.chat", - "version": "6.2.5", + "version": "6.2.6", "description": "Rocket.Chat Monorepo", "main": "index.js", "private": true, diff --git a/packages/base64/package.json b/packages/base64/package.json index 49af1a9c13ec..0dbaa4ccdd1e 100644 --- a/packages/base64/package.json +++ b/packages/base64/package.json @@ -1,5 +1,6 @@ { "name": "@rocket.chat/base64", + "private": true, "description": "Base64 encoding and decoding; Fork of Meteor's Base64 package", "version": "1.0.12", "main": "./dist/base64.js", diff --git a/packages/fuselage-ui-kit/package.json b/packages/fuselage-ui-kit/package.json index d3d9a9410bdb..bb16189a914f 100644 --- a/packages/fuselage-ui-kit/package.json +++ b/packages/fuselage-ui-kit/package.json @@ -1,5 +1,6 @@ { "name": "@rocket.chat/fuselage-ui-kit", + "private": true, "version": "0.31.16", "description": "UiKit elements for Rocket.Chat Apps built under Fuselage design system", "homepage": "https://rocketchat.github.io/Rocket.Chat.Fuselage/", diff --git a/packages/random/package.json b/packages/random/package.json index df0b6c522fbd..098750a30ae8 100644 --- a/packages/random/package.json +++ b/packages/random/package.json @@ -1,5 +1,6 @@ { "name": "@rocket.chat/random", + "private": true, "description": "Random number generator and utilities; Fork of Meteor's Random package", "version": "1.2.1", "main": "./dist/main.server.js", diff --git a/packages/release-action/.eslintrc.json b/packages/release-action/.eslintrc.json new file mode 100644 index 000000000000..a83aeda48e66 --- /dev/null +++ b/packages/release-action/.eslintrc.json @@ -0,0 +1,4 @@ +{ + "extends": ["@rocket.chat/eslint-config"], + "ignorePatterns": ["**/dist"] +} diff --git a/packages/release-action/.gitignore b/packages/release-action/.gitignore new file mode 100644 index 000000000000..849ddff3b7ec --- /dev/null +++ b/packages/release-action/.gitignore @@ -0,0 +1 @@ +dist/ diff --git a/packages/release-action/CHANGELOG.md b/packages/release-action/CHANGELOG.md new file mode 100644 index 000000000000..89b2647aa46a --- /dev/null +++ b/packages/release-action/CHANGELOG.md @@ -0,0 +1 @@ +# @rocket.chat/release-action diff --git a/packages/release-action/README.md b/packages/release-action/README.md new file mode 100644 index 000000000000..0122a5dcbca8 --- /dev/null +++ b/packages/release-action/README.md @@ -0,0 +1 @@ +# release-action diff --git a/packages/release-action/action.yml b/packages/release-action/action.yml new file mode 100644 index 000000000000..2fc8fe35d565 --- /dev/null +++ b/packages/release-action/action.yml @@ -0,0 +1,18 @@ +name: Changeset release +description: Action to cut and publish releases using changesets + +inputs: + action: + description: "The main action to perform: publish, publish-final, bump or patch" + required: true + base-ref: + description: "Base ref to use for the release" + required: false + +runs: + using: "node16" + main: "dist/index.js" + +branding: + icon: "package" + color: "blue" diff --git a/packages/release-action/package.json b/packages/release-action/package.json new file mode 100644 index 000000000000..3a2263385070 --- /dev/null +++ b/packages/release-action/package.json @@ -0,0 +1,30 @@ +{ + "name": "@rocket.chat/release-action", + "version": "0.0.1", + "private": true, + "scripts": { + "build": "tsc", + "lint": "eslint src", + "lint:fix": "eslint --fix src" + }, + "main": "dist/index.js", + "packageManager": "yarn@3.5.1", + "devDependencies": { + "@types/eslint": "^8", + "@types/node": "^16", + "typescript": "^5.1.3" + }, + "dependencies": { + "@actions/core": "^1.10.0", + "@actions/exec": "^1.1.1", + "@actions/github": "^5.1.1", + "@octokit/plugin-throttling": "^6.0.0", + "@rocket.chat/eslint-config": "workspace:^", + "eslint": "^8.42.0", + "mdast-util-to-string": "2", + "remark-parse": "9", + "remark-stringify": "9", + "semver": "^7.5.1", + "unified": "9" + } +} diff --git a/packages/release-action/src/bumpNextVersion.ts b/packages/release-action/src/bumpNextVersion.ts new file mode 100644 index 000000000000..00a459e917a4 --- /dev/null +++ b/packages/release-action/src/bumpNextVersion.ts @@ -0,0 +1,97 @@ +import fs from 'fs'; +import path from 'path'; + +import { exec } from '@actions/exec'; +import * as core from '@actions/core'; +import * as github from '@actions/github'; + +import { setupOctokit } from './setupOctokit'; +import { createNpmFile } from './createNpmFile'; +import { getChangelogEntry, updateVersionPackageJson } from './utils'; +import { fixWorkspaceVersionsBeforePublish } from './fixWorkspaceVersionsBeforePublish'; + +export async function bumpNextVersion({ + githubToken, + mainPackagePath, + cwd = process.cwd(), +}: { + githubToken: string; + mainPackagePath: string; + cwd?: string; +}) { + const octokit = setupOctokit(githubToken); + + // TODO do this only if publishing to npm + await createNpmFile(); + + // TODO need to check if there is any change to 'main package', if not, there is no need to enter rc + // and instead a normal release of the other packages should be done + + // start release candidate + await exec('yarn', ['changeset', 'pre', 'enter', 'rc']); + + // bump version of all packages to rc + await exec('yarn', ['changeset', 'version']); + + // get version from main package + const mainPackageJsonPath = path.join(mainPackagePath, 'package.json'); + // eslint-disable-next-line import/no-dynamic-require, @typescript-eslint/no-var-requires + const { version: newVersion } = require(mainPackageJsonPath); + + const mainPackageChangelog = path.join(mainPackagePath, 'CHANGELOG.md'); + + const changelogContents = fs.readFileSync(mainPackageChangelog, 'utf8'); + const changelogEntry = getChangelogEntry(changelogContents, newVersion); + if (!changelogEntry) { + // we can find a changelog but not the entry for this version + // if this is true, something has probably gone wrong + throw new Error('Could not find changelog entry for version newVersion'); + } + + const prBody = changelogEntry.content; + + const finalVersion = newVersion.split('-')[0]; + + const newBranch = `release-${finalVersion}`; + + // update root package.json + core.info('bump main package.json version'); + updateVersionPackageJson(cwd, newVersion); + + // TODO check if branch exists + await exec('git', ['checkout', '-b', newBranch]); + + await exec('git', ['add', '.']); + await exec('git', ['commit', '-m', newVersion]); + + core.info('fix dependencies in workspace packages'); + await fixWorkspaceVersionsBeforePublish(); + + await exec('yarn', ['changeset', 'publish']); + + await exec('git', ['push', '--force', '--follow-tags', 'origin', `HEAD:refs/heads/${newBranch}`]); + + if (newVersion.includes('rc.0')) { + const finalPrTitle = `Release ${finalVersion}`; + + core.info('creating pull request'); + await octokit.rest.pulls.create({ + base: 'master', + head: newBranch, + title: finalPrTitle, + body: prBody, + ...github.context.repo, + }); + } else { + core.info('no pull request created: release is not the first candidate'); + } + + core.info('create release'); + await octokit.rest.repos.createRelease({ + name: newVersion, + tag_name: newVersion, + body: prBody, + prerelease: newVersion.includes('-'), + ...github.context.repo, + }); +} diff --git a/packages/release-action/src/createNpmFile.ts b/packages/release-action/src/createNpmFile.ts new file mode 100644 index 000000000000..7facf1112078 --- /dev/null +++ b/packages/release-action/src/createNpmFile.ts @@ -0,0 +1,26 @@ +import fs from 'fs'; +import fsPromise from 'fs/promises'; + +import * as core from '@actions/core'; + +export async function createNpmFile() { + const userNpmrcPath = `${process.env.HOME}/.npmrc`; + + if (fs.existsSync(userNpmrcPath)) { + core.info('Found existing user .npmrc file'); + const userNpmrcContent = await fsPromise.readFile(userNpmrcPath, 'utf8'); + const authLine = userNpmrcContent.split('\n').find((line) => { + // check based on https://github.com/npm/cli/blob/8f8f71e4dd5ee66b3b17888faad5a7bf6c657eed/test/lib/adduser.js#L103-L105 + return /^\s*\/\/registry\.npmjs\.org\/:[_-]authToken=/i.test(line); + }); + if (authLine) { + core.info('Found existing auth token for the npm registry in the user .npmrc file'); + } else { + core.info("Didn't find existing auth token for the npm registry in the user .npmrc file, creating one"); + fs.appendFileSync(userNpmrcPath, `\n//registry.npmjs.org/:_authToken=${process.env.NPM_TOKEN}\n`); + } + } else { + core.info('No user .npmrc file found, creating one'); + fs.writeFileSync(userNpmrcPath, `//registry.npmjs.org/:_authToken=${process.env.NPM_TOKEN}\n`); + } +} diff --git a/packages/release-action/src/fixWorkspaceVersionsBeforePublish.ts b/packages/release-action/src/fixWorkspaceVersionsBeforePublish.ts new file mode 100644 index 000000000000..cf60265724e8 --- /dev/null +++ b/packages/release-action/src/fixWorkspaceVersionsBeforePublish.ts @@ -0,0 +1,60 @@ +// Changesets doesn't currently support workspace versions: +// https://github.com/changesets/changesets/issues/432 +// https://github.com/changesets/action/issues/246 +// To work around that, we'll manually resolve any `workspace:` version ranges +// with this tool prior to publishing. If/when changesets adds native support for +// publishing with Yarn 3, we can remove this script. +// +// We'll only support the `workspace:^` range, which is the only one we +// generally want to use. + +import fs from 'node:fs/promises'; +import path from 'node:path'; + +import { getExecOutput } from '@actions/exec'; + +const DEPENDENCY_TYPES = ['dependencies', 'devDependencies', 'peerDependencies']; + +export async function fixWorkspaceVersionsBeforePublish() { + const rawWorkspaces = await getExecOutput('yarn workspaces list --json'); + const workspaces = rawWorkspaces.stdout + .trim() + .split('\n') + .map((line) => JSON.parse(line)) + .filter((workspace) => workspace.location !== '.'); + + // Get the version of each workspace package. + const workspaceVersions = new Map(); + for await (const workspace of workspaces) { + const packageJsonPath = path.join(workspace.location, 'package.json'); + const packageJson = JSON.parse(await fs.readFile(packageJsonPath, 'utf8')); + workspaceVersions.set(workspace.name, packageJson.version); + } + + // Replace any `workspace:^` version ranges with the actual version. + for await (const workspace of workspaces) { + const packageJsonPath = path.join(workspace.location, 'package.json'); + const packageJson = JSON.parse(await fs.readFile(packageJsonPath, 'utf8')); + + for (const dependencyType of DEPENDENCY_TYPES) { + const dependencies = Object.keys(packageJson[dependencyType] ?? {}); + for (const dependency of dependencies) { + const dependencyVersion = packageJson[dependencyType][dependency]; + if (dependencyVersion.startsWith('workspace:')) { + if (!dependencyVersion.startsWith('workspace:^')) { + throw new Error(`Unsupported workspace version range: ${dependencyVersion}`); + } + + const realVersion = workspaceVersions.get(dependency); + if (!realVersion) { + throw new Error(`Could not find version for workspace ${dependency}`); + } + + packageJson[dependencyType][dependency] = `^${realVersion}`; + } + } + } + + await fs.writeFile(packageJsonPath, `${JSON.stringify(packageJson, null, 2)}\n`); + } +} diff --git a/packages/release-action/src/gitUtils.ts b/packages/release-action/src/gitUtils.ts new file mode 100644 index 000000000000..24afc9e49848 --- /dev/null +++ b/packages/release-action/src/gitUtils.ts @@ -0,0 +1,6 @@ +import { exec } from '@actions/exec'; + +export async function setupGitUser() { + await exec('git', ['config', 'user.name', '"github-actions[bot]"']); + await exec('git', ['config', 'user.email', '"github-actions[bot]@users.noreply.github.com"']); +} diff --git a/packages/release-action/src/index.ts b/packages/release-action/src/index.ts new file mode 100644 index 000000000000..ec9fafa165ea --- /dev/null +++ b/packages/release-action/src/index.ts @@ -0,0 +1,52 @@ +import fs from 'fs'; +import path from 'path'; + +import * as core from '@actions/core'; + +import { publishRelease } from './publishRelease'; +import { setupGitUser } from './gitUtils'; +import { bumpNextVersion } from './bumpNextVersion'; +import { startPatchRelease } from './startPatchRelease'; + +// const getOptionalInput = (name: string) => core.getInput(name) || undefined; + +(async () => { + const githubToken = process.env.GITHUB_TOKEN; + if (!githubToken) { + core.setFailed('Please add the GITHUB_TOKEN to the changesets action'); + return; + } + + // const inputCwd = core.getInput('cwd'); + // if (inputCwd) { + // core.info('changing directory to the one given as the input'); + // process.chdir(inputCwd); + // } + + core.info('setting git user'); + await setupGitUser(); + + core.info('setting GitHub credentials'); + fs.writeFileSync(`${process.env.HOME}/.netrc`, `machine github.com\nlogin github-actions[bot]\npassword ${githubToken}`); + + const action = core.getInput('action'); + const baseRef = core.getInput('base-ref'); + + const cwd = process.cwd(); + + // TODO this could be configurable + const mainPackagePath = path.join(cwd, 'apps', 'meteor'); + + if (action === 'publish-final') { + await publishRelease({ githubToken, exitCandidate: true, mainPackagePath }); + } else if (action === 'publish') { + await publishRelease({ githubToken, baseRef, mainPackagePath }); + } else if (action === 'bump') { + await bumpNextVersion({ githubToken, mainPackagePath }); + } else if (action === 'patch') { + await startPatchRelease({ baseRef, githubToken, mainPackagePath }); + } +})().catch((err) => { + core.error(err); + core.setFailed(err.message); +}); diff --git a/packages/release-action/src/publishRelease.ts b/packages/release-action/src/publishRelease.ts new file mode 100644 index 000000000000..4c6d1618ee38 --- /dev/null +++ b/packages/release-action/src/publishRelease.ts @@ -0,0 +1,96 @@ +import fs from 'fs'; +import path from 'path'; + +import { exec } from '@actions/exec'; +import * as github from '@actions/github'; +import * as core from '@actions/core'; + +import { createNpmFile } from './createNpmFile'; +import { setupOctokit } from './setupOctokit'; +import { getChangelogEntry, updateVersionPackageJson } from './utils'; +import { fixWorkspaceVersionsBeforePublish } from './fixWorkspaceVersionsBeforePublish'; + +export async function publishRelease({ + githubToken, + mainPackagePath, + exitCandidate = false, + baseRef, + cwd = process.cwd(), +}: { + githubToken: string; + mainPackagePath: string; + baseRef?: string; + exitCandidate?: boolean; + cwd?: string; +}) { + const octokit = setupOctokit(githubToken); + + // TODO do this only if publishing to npm + await createNpmFile(); + + if (baseRef) { + await exec('git', ['checkout', baseRef]); + } + + if (exitCandidate) { + let preRelease = false; + try { + fs.accessSync(path.resolve(cwd, '.changeset', 'pre.json')); + + preRelease = true; + } catch (e) { + // nothing to do, not a pre release + } + + if (preRelease) { + // finish release candidate + await exec('yarn', ['changeset', 'pre', 'exit']); + } + } + + // bump version of all packages + await exec('yarn', ['changeset', 'version']); + + // TODO if main package has no changes, throw error + + // get version from main package + const mainPackageJsonPath = path.join(mainPackagePath, 'package.json'); + + // eslint-disable-next-line import/no-dynamic-require, @typescript-eslint/no-var-requires + const { version: newVersion } = require(mainPackageJsonPath); + + const mainPackageChangelog = path.join(mainPackagePath, 'CHANGELOG.md'); + + const changelogContents = fs.readFileSync(mainPackageChangelog, 'utf8'); + const changelogEntry = getChangelogEntry(changelogContents, newVersion); + if (!changelogEntry) { + // we can find a changelog but not the entry for this version + // if this is true, something has probably gone wrong + throw new Error('Could not find changelog entry for version newVersion'); + } + + const releaseBody = changelogEntry.content; + + // update root package.json + core.info('bump main package.json version'); + updateVersionPackageJson(cwd, newVersion); + + await exec('git', ['add', '.']); + await exec('git', ['commit', '-m', newVersion]); + + core.info('fix dependencies in workspace packages'); + await fixWorkspaceVersionsBeforePublish(); + + await exec('yarn', ['changeset', 'publish']); + + await exec('git', ['push', '--follow-tags']); + + core.info('create release'); + await octokit.rest.repos.createRelease({ + name: newVersion, + tag_name: newVersion, + body: releaseBody, + prerelease: newVersion.includes('-'), + ...github.context.repo, + }); +} diff --git a/packages/release-action/src/setupOctokit.ts b/packages/release-action/src/setupOctokit.ts new file mode 100644 index 000000000000..1701ae9029bf --- /dev/null +++ b/packages/release-action/src/setupOctokit.ts @@ -0,0 +1,28 @@ +import * as core from '@actions/core'; +import { GitHub, getOctokitOptions } from '@actions/github/lib/utils'; +import { throttling } from '@octokit/plugin-throttling'; + +export const setupOctokit = (githubToken: string) => { + return new (GitHub.plugin(throttling))( + getOctokitOptions(githubToken, { + throttle: { + onRateLimit: (retryAfter, options, _octokit, retryCount) => { + core.warning(`Request quota exhausted for request ${(options as any).method} ${(options as any).url}`); + + if (retryCount <= 2) { + core.info(`Retrying after ${retryAfter} seconds!`); + return true; + } + }, + onSecondaryRateLimit: (retryAfter, options, _octokit, retryCount) => { + core.warning(`SecondaryRateLimit detected for request ${(options as any).method} ${(options as any).url}`); + + if (retryCount <= 2) { + core.info(`Retrying after ${retryAfter} seconds!`); + return true; + } + }, + }, + }), + ); +}; diff --git a/packages/release-action/src/startPatchRelease.ts b/packages/release-action/src/startPatchRelease.ts new file mode 100644 index 000000000000..320ee5e4c317 --- /dev/null +++ b/packages/release-action/src/startPatchRelease.ts @@ -0,0 +1,64 @@ +import path from 'path'; + +import semver from 'semver'; +import { exec } from '@actions/exec'; +import * as github from '@actions/github'; +import * as core from '@actions/core'; + +import { setupOctokit } from './setupOctokit'; +import { updateVersionPackageJson } from './utils'; + +export async function startPatchRelease({ + githubToken, + baseRef, + mainPackagePath, + cwd = process.cwd(), +}: { + baseRef: string; + mainPackagePath: string; + githubToken: string; + cwd?: string; +}) { + const octokit = setupOctokit(githubToken); + + await exec('git', ['checkout', baseRef]); + + // get version from main package + const mainPackageJsonPath = path.join(mainPackagePath, 'package.json'); + // eslint-disable-next-line import/no-dynamic-require, @typescript-eslint/no-var-requires + const { version } = require(mainPackageJsonPath); + + const newVersion = semver.inc(version, 'patch'); + if (!newVersion) { + throw new Error(`Could not increment version ${version}`); + } + + const newBranch = `release-${newVersion}`; + + // TODO check if branch exists + await exec('git', ['checkout', '-b', newBranch]); + + core.info('bump main package.json version'); + updateVersionPackageJson(cwd, newVersion); + + await exec('git', ['add', '.']); + await exec('git', ['commit', '-m', newVersion]); + + await exec('git', ['push', 'origin', `HEAD:refs/heads/${newBranch}`]); + + // create a pull request only if the patch is for current version + if (baseRef === 'master') { + const finalPrTitle = `Release ${newVersion}`; + + core.info('creating pull request'); + await octokit.rest.pulls.create({ + base: 'master', + head: newBranch, + title: finalPrTitle, + body: '', + ...github.context.repo, + }); + } else { + core.info('no pull request created: patch is not for current version'); + } +} diff --git a/packages/release-action/src/utils.ts b/packages/release-action/src/utils.ts new file mode 100644 index 000000000000..b8d8de9df66c --- /dev/null +++ b/packages/release-action/src/utils.ts @@ -0,0 +1,66 @@ +import fs from 'fs'; +import path from 'path'; + +import unified from 'unified'; +import remarkParse from 'remark-parse'; +import remarkStringify from 'remark-stringify'; +import mdastToString from 'mdast-util-to-string'; + +export const BumpLevels = { + dep: 0, + patch: 1, + minor: 2, + major: 3, +} as const; + +export function getChangelogEntry(changelog: string, version: string) { + const ast = unified().use(remarkParse).parse(changelog); + + let highestLevel: number = BumpLevels.dep; + + const nodes = (ast as any).children as Array; + let headingStartInfo: + | { + index: number; + depth: number; + } + | undefined; + let endIndex: number | undefined; + + for (let i = 0; i < nodes.length; i++) { + const node = nodes[i]; + if (node.type === 'heading') { + const stringified: string = mdastToString(node); + const match = stringified.toLowerCase().match(/(major|minor|patch)/); + if (match !== null) { + const level = BumpLevels[match[0] as 'major' | 'minor' | 'patch']; + highestLevel = Math.max(level, highestLevel); + } + if (headingStartInfo === undefined && stringified === version) { + headingStartInfo = { + index: i, + depth: node.depth, + }; + continue; + } + if (endIndex === undefined && headingStartInfo !== undefined && headingStartInfo.depth === node.depth) { + endIndex = i; + break; + } + } + } + if (headingStartInfo) { + (ast as any).children = ((ast as any).children as any).slice(headingStartInfo.index + 1, endIndex); + } + return { + content: unified().use(remarkStringify).stringify(ast), + highestLevel, + }; +} + +export function updateVersionPackageJson(cwd = process.cwd(), newVersion: string) { + const rootPackageJsonPath = path.resolve(cwd, 'package.json'); + const content = fs.readFileSync(rootPackageJsonPath, 'utf8'); + const updatedContent = content.replace(/"version": ".*",$/m, `"version": "${newVersion}",`); + fs.writeFileSync(rootPackageJsonPath, updatedContent); +} diff --git a/packages/release-action/tsconfig.json b/packages/release-action/tsconfig.json new file mode 100644 index 000000000000..d9d2e25d6609 --- /dev/null +++ b/packages/release-action/tsconfig.json @@ -0,0 +1,109 @@ +{ + "compilerOptions": { + /* Visit https://aka.ms/tsconfig to read more about this file */ + + /* Projects */ + // "incremental": true, /* Save .tsbuildinfo files to allow for incremental compilation of projects. */ + // "composite": true, /* Enable constraints that allow a TypeScript project to be used with project references. */ + // "tsBuildInfoFile": "./.tsbuildinfo", /* Specify the path to .tsbuildinfo incremental compilation file. */ + // "disableSourceOfProjectReferenceRedirect": true, /* Disable preferring source files instead of declaration files when referencing composite projects. */ + // "disableSolutionSearching": true, /* Opt a project out of multi-project reference checking when editing. */ + // "disableReferencedProjectLoad": true, /* Reduce the number of projects loaded automatically by TypeScript. */ + + /* Language and Environment */ + "target": "esnext", /* Set the JavaScript language version for emitted JavaScript and include compatible library declarations. */ + // "lib": [], /* Specify a set of bundled library declaration files that describe the target runtime environment. */ + // "jsx": "preserve", /* Specify what JSX code is generated. */ + // "experimentalDecorators": true, /* Enable experimental support for legacy experimental decorators. */ + // "emitDecoratorMetadata": true, /* Emit design-type metadata for decorated declarations in source files. */ + // "jsxFactory": "", /* Specify the JSX factory function used when targeting React JSX emit, e.g. 'React.createElement' or 'h'. */ + // "jsxFragmentFactory": "", /* Specify the JSX Fragment reference used for fragments when targeting React JSX emit e.g. 'React.Fragment' or 'Fragment'. */ + // "jsxImportSource": "", /* Specify module specifier used to import the JSX factory functions when using 'jsx: react-jsx*'. */ + // "reactNamespace": "", /* Specify the object invoked for 'createElement'. This only applies when targeting 'react' JSX emit. */ + // "noLib": true, /* Disable including any library files, including the default lib.d.ts. */ + // "useDefineForClassFields": true, /* Emit ECMAScript-standard-compliant class fields. */ + // "moduleDetection": "auto", /* Control what method is used to detect module-format JS files. */ + + /* Modules */ + "module": "commonjs", /* Specify what module code is generated. */ + "rootDir": "src/", /* Specify the root folder within your source files. */ + // "moduleResolution": "node10", /* Specify how TypeScript looks up a file from a given module specifier. */ + // "baseUrl": "./", /* Specify the base directory to resolve non-relative module names. */ + // "paths": {}, /* Specify a set of entries that re-map imports to additional lookup locations. */ + // "rootDirs": [], /* Allow multiple folders to be treated as one when resolving modules. */ + // "typeRoots": [], /* Specify multiple folders that act like './node_modules/@types'. */ + // "types": [], /* Specify type package names to be included without being referenced in a source file. */ + // "allowUmdGlobalAccess": true, /* Allow accessing UMD globals from modules. */ + // "moduleSuffixes": [], /* List of file name suffixes to search when resolving a module. */ + // "allowImportingTsExtensions": true, /* Allow imports to include TypeScript file extensions. Requires '--moduleResolution bundler' and either '--noEmit' or '--emitDeclarationOnly' to be set. */ + // "resolvePackageJsonExports": true, /* Use the package.json 'exports' field when resolving package imports. */ + // "resolvePackageJsonImports": true, /* Use the package.json 'imports' field when resolving imports. */ + // "customConditions": [], /* Conditions to set in addition to the resolver-specific defaults when resolving imports. */ + // "resolveJsonModule": true, /* Enable importing .json files. */ + // "allowArbitraryExtensions": true, /* Enable importing files with any extension, provided a declaration file is present. */ + // "noResolve": true, /* Disallow 'import's, 'require's or ''s from expanding the number of files TypeScript should add to a project. */ + + /* JavaScript Support */ + // "allowJs": true, /* Allow JavaScript files to be a part of your program. Use the 'checkJS' option to get errors from these files. */ + // "checkJs": true, /* Enable error reporting in type-checked JavaScript files. */ + // "maxNodeModuleJsDepth": 1, /* Specify the maximum folder depth used for checking JavaScript files from 'node_modules'. Only applicable with 'allowJs'. */ + + /* Emit */ + // "declaration": true, /* Generate .d.ts files from TypeScript and JavaScript files in your project. */ + // "declarationMap": true, /* Create sourcemaps for d.ts files. */ + // "emitDeclarationOnly": true, /* Only output d.ts files and not JavaScript files. */ + // "sourceMap": true, /* Create source map files for emitted JavaScript files. */ + // "inlineSourceMap": true, /* Include sourcemap files inside the emitted JavaScript. */ + // "outFile": "./", /* Specify a file that bundles all outputs into one JavaScript file. If 'declaration' is true, also designates a file that bundles all .d.ts output. */ + "outDir": "dist/", /* Specify an output folder for all emitted files. */ + // "removeComments": true, /* Disable emitting comments. */ + // "noEmit": true, /* Disable emitting files from a compilation. */ + // "importHelpers": true, /* Allow importing helper functions from tslib once per project, instead of including them per-file. */ + // "importsNotUsedAsValues": "remove", /* Specify emit/checking behavior for imports that are only used for types. */ + // "downlevelIteration": true, /* Emit more compliant, but verbose and less performant JavaScript for iteration. */ + // "sourceRoot": "", /* Specify the root path for debuggers to find the reference source code. */ + // "mapRoot": "", /* Specify the location where debugger should locate map files instead of generated locations. */ + // "inlineSources": true, /* Include source code in the sourcemaps inside the emitted JavaScript. */ + // "emitBOM": true, /* Emit a UTF-8 Byte Order Mark (BOM) in the beginning of output files. */ + // "newLine": "crlf", /* Set the newline character for emitting files. */ + // "stripInternal": true, /* Disable emitting declarations that have '@internal' in their JSDoc comments. */ + // "noEmitHelpers": true, /* Disable generating custom helper functions like '__extends' in compiled output. */ + // "noEmitOnError": true, /* Disable emitting files if any type checking errors are reported. */ + // "preserveConstEnums": true, /* Disable erasing 'const enum' declarations in generated code. */ + // "declarationDir": "./", /* Specify the output directory for generated declaration files. */ + // "preserveValueImports": true, /* Preserve unused imported values in the JavaScript output that would otherwise be removed. */ + + /* Interop Constraints */ + // "isolatedModules": true, /* Ensure that each file can be safely transpiled without relying on other imports. */ + // "verbatimModuleSyntax": true, /* Do not transform or elide any imports or exports not marked as type-only, ensuring they are written in the output file's format based on the 'module' setting. */ + // "allowSyntheticDefaultImports": true, /* Allow 'import x from y' when a module doesn't have a default export. */ + "esModuleInterop": true, /* Emit additional JavaScript to ease support for importing CommonJS modules. This enables 'allowSyntheticDefaultImports' for type compatibility. */ + // "preserveSymlinks": true, /* Disable resolving symlinks to their realpath. This correlates to the same flag in node. */ + "forceConsistentCasingInFileNames": true, /* Ensure that casing is correct in imports. */ + + /* Type Checking */ + "strict": true, /* Enable all strict type-checking options. */ + // "noImplicitAny": true, /* Enable error reporting for expressions and declarations with an implied 'any' type. */ + // "strictNullChecks": true, /* When type checking, take into account 'null' and 'undefined'. */ + // "strictFunctionTypes": true, /* When assigning functions, check to ensure parameters and the return values are subtype-compatible. */ + // "strictBindCallApply": true, /* Check that the arguments for 'bind', 'call', and 'apply' methods match the original function. */ + // "strictPropertyInitialization": true, /* Check for class properties that are declared but not set in the constructor. */ + // "noImplicitThis": true, /* Enable error reporting when 'this' is given the type 'any'. */ + // "useUnknownInCatchVariables": true, /* Default catch clause variables as 'unknown' instead of 'any'. */ + // "alwaysStrict": true, /* Ensure 'use strict' is always emitted. */ + // "noUnusedLocals": true, /* Enable error reporting when local variables aren't read. */ + // "noUnusedParameters": true, /* Raise an error when a function parameter isn't read. */ + // "exactOptionalPropertyTypes": true, /* Interpret optional property types as written, rather than adding 'undefined'. */ + // "noImplicitReturns": true, /* Enable error reporting for codepaths that do not explicitly return in a function. */ + // "noFallthroughCasesInSwitch": true, /* Enable error reporting for fallthrough cases in switch statements. */ + // "noUncheckedIndexedAccess": true, /* Add 'undefined' to a type when accessed using an index. */ + // "noImplicitOverride": true, /* Ensure overriding members in derived classes are marked with an override modifier. */ + // "noPropertyAccessFromIndexSignature": true, /* Enforces using indexed accessors for keys declared using an indexed type. */ + // "allowUnusedLabels": true, /* Disable error reporting for unused labels. */ + // "allowUnreachableCode": true, /* Disable error reporting for unreachable code. */ + + /* Completeness */ + // "skipDefaultLibCheck": true, /* Skip type checking .d.ts files that are included with TypeScript. */ + "skipLibCheck": true /* Skip type checking all .d.ts files. */ + } +} diff --git a/packages/sha256/package.json b/packages/sha256/package.json index 30e9d349e738..76dcec7e5507 100644 --- a/packages/sha256/package.json +++ b/packages/sha256/package.json @@ -1,5 +1,6 @@ { "name": "@rocket.chat/sha256", + "private": true, "description": "SHA256 implementation; Fork of Meteor's SHA256 package", "version": "1.0.9", "main": "./dist/sha256.js", diff --git a/yarn.lock b/yarn.lock index 4ceb26bf28e0..259cb2ddad20 100644 --- a/yarn.lock +++ b/yarn.lock @@ -5,6 +5,53 @@ __metadata: version: 6 cacheKey: 8 +"@actions/core@npm:^1.10.0": + version: 1.10.0 + resolution: "@actions/core@npm:1.10.0" + dependencies: + "@actions/http-client": ^2.0.1 + uuid: ^8.3.2 + checksum: 0a75621e007ab20d887434cdd165f0b9036f14c22252a2faed33543d8b9d04ec95d823e69ca636a25245574e4585d73e1e9e47a845339553c664f9f2c9614669 + languageName: node + linkType: hard + +"@actions/exec@npm:^1.1.1": + version: 1.1.1 + resolution: "@actions/exec@npm:1.1.1" + dependencies: + "@actions/io": ^1.0.1 + checksum: d976e66dd51ab03d76a143da8e1406daa1bcdee06046168e6e0bec681c87a12999eefaad7a81cb81f28e4190610f55a58b8458ae4b82cbaaba13200490f4e8c2 + languageName: node + linkType: hard + +"@actions/github@npm:^5.1.1": + version: 5.1.1 + resolution: "@actions/github@npm:5.1.1" + dependencies: + "@actions/http-client": ^2.0.1 + "@octokit/core": ^3.6.0 + "@octokit/plugin-paginate-rest": ^2.17.0 + "@octokit/plugin-rest-endpoint-methods": ^5.13.0 + checksum: 2210bd7f8e1e8b407b7df74a259523dc4c63f4ad3a6bfcc0d7867b6e9c3499bd3e25d7de7a9a1bbd0de3be441a8832d5c0b5c0cff3036cd477378c0ec5502434 + languageName: node + linkType: hard + +"@actions/http-client@npm:^2.0.1": + version: 2.1.0 + resolution: "@actions/http-client@npm:2.1.0" + dependencies: + tunnel: ^0.0.6 + checksum: 25a72a952cc95fb4b3ab086da73a5754dd0957c206637cace69be2e16f018cc1b3d3c40d3bcf89ffd8a5929d5e8445594b498b50db306a50ad7536023f8e3800 + languageName: node + linkType: hard + +"@actions/io@npm:^1.0.1": + version: 1.1.3 + resolution: "@actions/io@npm:1.1.3" + checksum: 42841ac2b8a7afb29456b9edb5534dbe00148893c794bdbc17d29166847c51c884e2a7c087a489a428250a78e7b54bc761ba3b55eb2f97d9600e9193b60caf0b + languageName: node + linkType: hard + "@adobe/css-tools@npm:^4.0.1": version: 4.0.1 resolution: "@adobe/css-tools@npm:4.0.1" @@ -2818,6 +2865,24 @@ __metadata: languageName: node linkType: hard +"@eslint-community/eslint-utils@npm:^4.2.0": + version: 4.4.0 + resolution: "@eslint-community/eslint-utils@npm:4.4.0" + dependencies: + eslint-visitor-keys: ^3.3.0 + peerDependencies: + eslint: ^6.0.0 || ^7.0.0 || >=8.0.0 + checksum: cdfe3ae42b4f572cbfb46d20edafe6f36fc5fb52bf2d90875c58aefe226892b9677fef60820e2832caf864a326fe4fc225714c46e8389ccca04d5f9288aabd22 + languageName: node + linkType: hard + +"@eslint-community/regexpp@npm:^4.4.0": + version: 4.5.1 + resolution: "@eslint-community/regexpp@npm:4.5.1" + checksum: 6d901166d64998d591fab4db1c2f872981ccd5f6fe066a1ad0a93d4e11855ecae6bfb76660869a469563e8882d4307228cebd41142adb409d182f2966771e57e + languageName: node + linkType: hard + "@eslint/eslintrc@npm:^0.4.3": version: 0.4.3 resolution: "@eslint/eslintrc@npm:0.4.3" @@ -2852,6 +2917,30 @@ __metadata: languageName: node linkType: hard +"@eslint/eslintrc@npm:^2.0.3": + version: 2.0.3 + resolution: "@eslint/eslintrc@npm:2.0.3" + dependencies: + ajv: ^6.12.4 + debug: ^4.3.2 + espree: ^9.5.2 + globals: ^13.19.0 + ignore: ^5.2.0 + import-fresh: ^3.2.1 + js-yaml: ^4.1.0 + minimatch: ^3.1.2 + strip-json-comments: ^3.1.1 + checksum: ddc51f25f8524d8231db9c9bf03177e503d941a332e8d5ce3b10b09241be4d5584a378a529a27a527586bfbccf3031ae539eb891352033c340b012b4d0c81d92 + languageName: node + linkType: hard + +"@eslint/js@npm:8.42.0": + version: 8.42.0 + resolution: "@eslint/js@npm:8.42.0" + checksum: 750558843ac458f7da666122083ee05306fc087ecc1e5b21e7e14e23885775af6c55bcc92283dff1862b7b0d8863ec676c0f18c7faf1219c722fe91a8ece56b6 + languageName: node + linkType: hard + "@faker-js/faker@npm:^6.3.1": version: 6.3.1 resolution: "@faker-js/faker@npm:6.3.1" @@ -2970,6 +3059,17 @@ __metadata: languageName: node linkType: hard +"@humanwhocodes/config-array@npm:^0.11.10": + version: 0.11.10 + resolution: "@humanwhocodes/config-array@npm:0.11.10" + dependencies: + "@humanwhocodes/object-schema": ^1.2.1 + debug: ^4.1.1 + minimatch: ^3.0.5 + checksum: 1b1302e2403d0e35bc43e66d67a2b36b0ad1119efc704b5faff68c41f791a052355b010fb2d27ef022670f550de24cd6d08d5ecf0821c16326b7dcd0ee5d5d8a + languageName: node + linkType: hard + "@humanwhocodes/config-array@npm:^0.11.6, @humanwhocodes/config-array@npm:^0.11.8": version: 0.11.8 resolution: "@humanwhocodes/config-array@npm:0.11.8" @@ -3971,6 +4071,144 @@ __metadata: languageName: node linkType: hard +"@octokit/auth-token@npm:^2.4.4": + version: 2.5.0 + resolution: "@octokit/auth-token@npm:2.5.0" + dependencies: + "@octokit/types": ^6.0.3 + checksum: 45949296c09abcd6beb4c3f69d45b0c1f265f9581d2a9683cf4d1800c4cf8259c2f58d58e44c16c20bffb85a0282a176c0d51f4af300e428b863f27b910e6297 + languageName: node + linkType: hard + +"@octokit/core@npm:^3.6.0": + version: 3.6.0 + resolution: "@octokit/core@npm:3.6.0" + dependencies: + "@octokit/auth-token": ^2.4.4 + "@octokit/graphql": ^4.5.8 + "@octokit/request": ^5.6.3 + "@octokit/request-error": ^2.0.5 + "@octokit/types": ^6.0.3 + before-after-hook: ^2.2.0 + universal-user-agent: ^6.0.0 + checksum: f81160129037bd8555d47db60cd5381637b7e3602ad70735a7bdf8f3d250c7b7114a666bb12ef7a8746a326a5d72ed30a1b8f8a5a170007f7285c8e217bef1f0 + languageName: node + linkType: hard + +"@octokit/endpoint@npm:^6.0.1": + version: 6.0.12 + resolution: "@octokit/endpoint@npm:6.0.12" + dependencies: + "@octokit/types": ^6.0.3 + is-plain-object: ^5.0.0 + universal-user-agent: ^6.0.0 + checksum: b48b29940af11c4b9bca41cf56809754bb8385d4e3a6122671799d27f0238ba575b3fde86d2d30a84f4dbbc14430940de821e56ecc6a9a92d47fc2b29a31479d + languageName: node + linkType: hard + +"@octokit/graphql@npm:^4.5.8": + version: 4.8.0 + resolution: "@octokit/graphql@npm:4.8.0" + dependencies: + "@octokit/request": ^5.6.0 + "@octokit/types": ^6.0.3 + universal-user-agent: ^6.0.0 + checksum: f68afe53f63900d4a16a0a733f2f500df2695b731f8ed32edb728d50edead7f5011437f71d069c2d2f6d656227703d0c832a3c8af58ecf82bd5dcc051f2d2d74 + languageName: node + linkType: hard + +"@octokit/openapi-types@npm:^12.11.0": + version: 12.11.0 + resolution: "@octokit/openapi-types@npm:12.11.0" + checksum: 8a7d4bd6288cc4085cabe0ca9af2b87c875c303af932cb138aa1b2290eb69d32407759ac23707bb02776466e671244a902e9857896903443a69aff4b6b2b0e3b + languageName: node + linkType: hard + +"@octokit/openapi-types@npm:^18.0.0": + version: 18.0.0 + resolution: "@octokit/openapi-types@npm:18.0.0" + checksum: d487d6c6c1965e583eee417d567e4fe3357a98953fc49bce1a88487e7908e9b5dbb3e98f60dfa340e23b1792725fbc006295aea071c5667a813b9c098185b56f + languageName: node + linkType: hard + +"@octokit/plugin-paginate-rest@npm:^2.17.0": + version: 2.21.3 + resolution: "@octokit/plugin-paginate-rest@npm:2.21.3" + dependencies: + "@octokit/types": ^6.40.0 + peerDependencies: + "@octokit/core": ">=2" + checksum: acf31de2ba4021bceec7ff49c5b0e25309fc3c009d407f153f928ddf436ab66cd4217344138378d5523f5fb233896e1db58c9c7b3ffd9612a66d760bc5d319ed + languageName: node + linkType: hard + +"@octokit/plugin-rest-endpoint-methods@npm:^5.13.0": + version: 5.16.2 + resolution: "@octokit/plugin-rest-endpoint-methods@npm:5.16.2" + dependencies: + "@octokit/types": ^6.39.0 + deprecation: ^2.3.1 + peerDependencies: + "@octokit/core": ">=3" + checksum: 30fcc50c335d1093f03573d9fa3a4b7d027fc98b215c43e07e82ee8dabfa0af0cf1b963feb542312ae32d897a2f68dc671577206f30850215517bebedc5a2c73 + languageName: node + linkType: hard + +"@octokit/plugin-throttling@npm:^6.0.0": + version: 6.1.0 + resolution: "@octokit/plugin-throttling@npm:6.1.0" + dependencies: + "@octokit/types": ^9.0.0 + bottleneck: ^2.15.3 + peerDependencies: + "@octokit/core": ^4.0.0 + checksum: 7c0cdda560e70a4925ea2ee6afbef0a3e241ba16dadb4d55d285ca93e6cf986cbdd6c1fc34c34ca0d2d402261af49d7912a9ba9ff32b29011997752468864980 + languageName: node + linkType: hard + +"@octokit/request-error@npm:^2.0.5, @octokit/request-error@npm:^2.1.0": + version: 2.1.0 + resolution: "@octokit/request-error@npm:2.1.0" + dependencies: + "@octokit/types": ^6.0.3 + deprecation: ^2.0.0 + once: ^1.4.0 + checksum: baec2b5700498be01b4d958f9472cb776b3f3b0ea52924323a07e7a88572e24cac2cdf7eb04a0614031ba346043558b47bea2d346e98f0e8385b4261f138ef18 + languageName: node + linkType: hard + +"@octokit/request@npm:^5.6.0, @octokit/request@npm:^5.6.3": + version: 5.6.3 + resolution: "@octokit/request@npm:5.6.3" + dependencies: + "@octokit/endpoint": ^6.0.1 + "@octokit/request-error": ^2.1.0 + "@octokit/types": ^6.16.1 + is-plain-object: ^5.0.0 + node-fetch: ^2.6.7 + universal-user-agent: ^6.0.0 + checksum: c0b4542eb4baaf880d673c758d3e0b5c4a625a4ae30abf40df5548b35f1ff540edaac74625192b1aff42a79ac661e774da4ab7d5505f1cb4ef81239b1e8510c5 + languageName: node + linkType: hard + +"@octokit/types@npm:^6.0.3, @octokit/types@npm:^6.16.1, @octokit/types@npm:^6.39.0, @octokit/types@npm:^6.40.0": + version: 6.41.0 + resolution: "@octokit/types@npm:6.41.0" + dependencies: + "@octokit/openapi-types": ^12.11.0 + checksum: fd6f75e0b19b90d1a3d244d2b0c323ed8f2f05e474a281f60a321986683548ef2e0ec2b3a946aa9405d6092e055344455f69f58957c60f58368c8bdda5b7d2ab + languageName: node + linkType: hard + +"@octokit/types@npm:^9.0.0": + version: 9.3.1 + resolution: "@octokit/types@npm:9.3.1" + dependencies: + "@octokit/openapi-types": ^18.0.0 + checksum: 56fce104114730553c79175261f288a263055af4a6de848130fa964940460ee4fe8fa610f33dd0862c2c178d7d97f703e44a799898f3b52583e7ce5ae595f8ff + languageName: node + linkType: hard + "@opencensus/core@npm:0.0.9": version: 0.0.9 resolution: "@opencensus/core@npm:0.0.9" @@ -7475,6 +7713,27 @@ __metadata: languageName: unknown linkType: soft +"@rocket.chat/release-action@workspace:packages/release-action": + version: 0.0.0-use.local + resolution: "@rocket.chat/release-action@workspace:packages/release-action" + dependencies: + "@actions/core": ^1.10.0 + "@actions/exec": ^1.1.1 + "@actions/github": ^5.1.1 + "@octokit/plugin-throttling": ^6.0.0 + "@rocket.chat/eslint-config": "workspace:^" + "@types/eslint": ^8 + "@types/node": ^16 + eslint: ^8.42.0 + mdast-util-to-string: 2 + remark-parse: 9 + remark-stringify: 9 + semver: ^7.5.1 + typescript: ^5.1.3 + unified: 9 + languageName: unknown + linkType: soft + "@rocket.chat/rest-typings@workspace:^, @rocket.chat/rest-typings@workspace:packages/rest-typings": version: 0.0.0-use.local resolution: "@rocket.chat/rest-typings@workspace:packages/rest-typings" @@ -10280,6 +10539,16 @@ __metadata: languageName: node linkType: hard +"@types/eslint@npm:^8": + version: 8.40.1 + resolution: "@types/eslint@npm:8.40.1" + dependencies: + "@types/estree": "*" + "@types/json-schema": "*" + checksum: c210e4741f11d9fda0e06f4444a43f64af79ea72d60cd11ec4acc232374b34cbb49634286f949783d55d8a66b44fa0da041b6a90cfe37fcdf7f796b81776318b + languageName: node + linkType: hard + "@types/estree@npm:*, @types/estree@npm:^0.0.51": version: 0.0.51 resolution: "@types/estree@npm:0.0.51" @@ -10750,6 +11019,13 @@ __metadata: languageName: node linkType: hard +"@types/node@npm:^16": + version: 16.18.35 + resolution: "@types/node@npm:16.18.35" + checksum: 68e3015eb24f009d2b5a7ad959d1e1090016847248f22242c520b75a2780eb19e2d212e775e68022ed474fac00bcc8edaebcd02712f1dfee542efa23e2a4027e + languageName: node + linkType: hard + "@types/nodemailer@npm:*, @types/nodemailer@npm:^6.4.4": version: 6.4.7 resolution: "@types/nodemailer@npm:6.4.7" @@ -13513,6 +13789,13 @@ __metadata: languageName: node linkType: hard +"before-after-hook@npm:^2.2.0": + version: 2.2.3 + resolution: "before-after-hook@npm:2.2.3" + checksum: a1a2430976d9bdab4cd89cb50d27fa86b19e2b41812bf1315923b0cba03371ebca99449809226425dd3bcef20e010db61abdaff549278e111d6480034bebae87 + languageName: node + linkType: hard + "better-opn@npm:^2.1.1": version: 2.1.1 resolution: "better-opn@npm:2.1.1" @@ -13799,6 +14082,13 @@ __metadata: languageName: node linkType: hard +"bottleneck@npm:^2.15.3": + version: 2.19.5 + resolution: "bottleneck@npm:2.19.5" + checksum: c5eef1bbea12cef1f1405e7306e7d24860568b0f7ac5eeab706a86762b3fc65ef6d1c641c8a166e4db90f412fc5c948fc5ce8008a8cd3d28c7212ef9c3482bda + languageName: node + linkType: hard + "bowser@npm:^2.11.0": version: 2.11.0 resolution: "bowser@npm:2.11.0" @@ -16570,7 +16860,7 @@ __metadata: languageName: node linkType: hard -"debug@npm:4, debug@npm:^4.0.1, debug@npm:^4.1.0, debug@npm:^4.1.1, debug@npm:^4.2.0, debug@npm:^4.3.1, debug@npm:^4.3.2, debug@npm:^4.3.3, debug@npm:^4.3.4, debug@npm:~4.3.1": +"debug@npm:4, debug@npm:^4.0.0, debug@npm:^4.0.1, debug@npm:^4.1.0, debug@npm:^4.1.1, debug@npm:^4.2.0, debug@npm:^4.3.1, debug@npm:^4.3.2, debug@npm:^4.3.3, debug@npm:^4.3.4, debug@npm:~4.3.1": version: 4.3.4 resolution: "debug@npm:4.3.4" dependencies: @@ -16951,6 +17241,13 @@ __metadata: languageName: node linkType: hard +"deprecation@npm:^2.0.0, deprecation@npm:^2.3.1": + version: 2.3.1 + resolution: "deprecation@npm:2.3.1" + checksum: f56a05e182c2c195071385455956b0c4106fe14e36245b00c689ceef8e8ab639235176a96977ba7c74afb173317fac2e0ec6ec7a1c6d1e6eaa401c586c714132 + languageName: node + linkType: hard + "des.js@npm:^1.0.0": version: 1.0.1 resolution: "des.js@npm:1.0.1" @@ -18232,6 +18529,16 @@ __metadata: languageName: node linkType: hard +"eslint-scope@npm:^7.2.0": + version: 7.2.0 + resolution: "eslint-scope@npm:7.2.0" + dependencies: + esrecurse: ^4.3.0 + estraverse: ^5.2.0 + checksum: 64591a2d8b244ade9c690b59ef238a11d5c721a98bcee9e9f445454f442d03d3e04eda88e95a4daec558220a99fa384309d9faae3d459bd40e7a81b4063980ae + languageName: node + linkType: hard + "eslint-utils@npm:^2.1.0": version: 2.1.0 resolution: "eslint-utils@npm:2.1.0" @@ -18273,6 +18580,13 @@ __metadata: languageName: node linkType: hard +"eslint-visitor-keys@npm:^3.4.1": + version: 3.4.1 + resolution: "eslint-visitor-keys@npm:3.4.1" + checksum: f05121d868202736b97de7d750847a328fcfa8593b031c95ea89425333db59676ac087fa905eba438d0a3c5769632f828187e0c1a0d271832a2153c1d3661c2c + languageName: node + linkType: hard + "eslint@npm:^7.32.0": version: 7.32.0 resolution: "eslint@npm:7.32.0" @@ -18372,6 +18686,55 @@ __metadata: languageName: node linkType: hard +"eslint@npm:^8.42.0": + version: 8.42.0 + resolution: "eslint@npm:8.42.0" + dependencies: + "@eslint-community/eslint-utils": ^4.2.0 + "@eslint-community/regexpp": ^4.4.0 + "@eslint/eslintrc": ^2.0.3 + "@eslint/js": 8.42.0 + "@humanwhocodes/config-array": ^0.11.10 + "@humanwhocodes/module-importer": ^1.0.1 + "@nodelib/fs.walk": ^1.2.8 + ajv: ^6.10.0 + chalk: ^4.0.0 + cross-spawn: ^7.0.2 + debug: ^4.3.2 + doctrine: ^3.0.0 + escape-string-regexp: ^4.0.0 + eslint-scope: ^7.2.0 + eslint-visitor-keys: ^3.4.1 + espree: ^9.5.2 + esquery: ^1.4.2 + esutils: ^2.0.2 + fast-deep-equal: ^3.1.3 + file-entry-cache: ^6.0.1 + find-up: ^5.0.0 + glob-parent: ^6.0.2 + globals: ^13.19.0 + graphemer: ^1.4.0 + ignore: ^5.2.0 + import-fresh: ^3.0.0 + imurmurhash: ^0.1.4 + is-glob: ^4.0.0 + is-path-inside: ^3.0.3 + js-yaml: ^4.1.0 + json-stable-stringify-without-jsonify: ^1.0.1 + levn: ^0.4.1 + lodash.merge: ^4.6.2 + minimatch: ^3.1.2 + natural-compare: ^1.4.0 + optionator: ^0.9.1 + strip-ansi: ^6.0.1 + strip-json-comments: ^3.1.0 + text-table: ^0.2.0 + bin: + eslint: bin/eslint.js + checksum: 07105397b5f2ff4064b983b8971e8c379ec04b1dfcc9d918976b3e00377189000161dac991d82ba14f8759e466091b8c71146f602930ca810c290ee3fcb3faf0 + languageName: node + linkType: hard + "eslint@npm:~8.29.0": version: 8.29.0 resolution: "eslint@npm:8.29.0" @@ -18443,6 +18806,17 @@ __metadata: languageName: node linkType: hard +"espree@npm:^9.5.2": + version: 9.5.2 + resolution: "espree@npm:9.5.2" + dependencies: + acorn: ^8.8.0 + acorn-jsx: ^5.3.2 + eslint-visitor-keys: ^3.4.1 + checksum: 6506289d6eb26471c0b383ee24fee5c8ae9d61ad540be956b3127be5ce3bf687d2ba6538ee5a86769812c7c552a9d8239e8c4d150f9ea056c6d5cbe8399c03c1 + languageName: node + linkType: hard + "esprima@npm:^4.0.0, esprima@npm:^4.0.1": version: 4.0.1 resolution: "esprima@npm:4.0.1" @@ -18462,6 +18836,15 @@ __metadata: languageName: node linkType: hard +"esquery@npm:^1.4.2": + version: 1.5.0 + resolution: "esquery@npm:1.5.0" + dependencies: + estraverse: ^5.1.0 + checksum: aefb0d2596c230118656cd4ec7532d447333a410a48834d80ea648b1e7b5c9bc9ed8b5e33a89cb04e487b60d622f44cf5713bf4abed7c97343edefdc84a35900 + languageName: node + linkType: hard + "esrecurse@npm:^4.1.0, esrecurse@npm:^4.3.0": version: 4.3.0 resolution: "esrecurse@npm:4.3.0" @@ -20684,6 +21067,13 @@ __metadata: languageName: node linkType: hard +"graphemer@npm:^1.4.0": + version: 1.4.0 + resolution: "graphemer@npm:1.4.0" + checksum: bab8f0be9b568857c7bec9fda95a89f87b783546d02951c40c33f84d05bb7da3fd10f863a9beb901463669b6583173a8c8cc6d6b306ea2b9b9d5d3d943c3a673 + languageName: node + linkType: hard + "gravatar@npm:^1.8.2": version: 1.8.2 resolution: "gravatar@npm:1.8.2" @@ -25066,6 +25456,13 @@ __metadata: languageName: node linkType: hard +"longest-streak@npm:^2.0.0": + version: 2.0.4 + resolution: "longest-streak@npm:2.0.4" + checksum: 28b8234a14963002c5c71035dee13a0a11e9e9d18ffa320fdc8796ed7437399204495702ed69cd2a7087b0af041a2a8b562829b7c1e2042e73a3374d1ecf6580 + languageName: node + linkType: hard + "loose-envify@npm:^1.0.0, loose-envify@npm:^1.1.0, loose-envify@npm:^1.4.0": version: 1.4.0 resolution: "loose-envify@npm:1.4.0" @@ -25463,6 +25860,19 @@ __metadata: languageName: node linkType: hard +"mdast-util-from-markdown@npm:^0.8.0": + version: 0.8.5 + resolution: "mdast-util-from-markdown@npm:0.8.5" + dependencies: + "@types/mdast": ^3.0.0 + mdast-util-to-string: ^2.0.0 + micromark: ~2.11.0 + parse-entities: ^2.0.0 + unist-util-stringify-position: ^2.0.0 + checksum: 5a9d0d753a42db763761e874c22365d0c7c9934a5a18b5ff76a0643610108a208a041ffdb2f3d3dd1863d3d915225a4020a0aade282af0facfd0df110601eee6 + languageName: node + linkType: hard + "mdast-util-to-hast@npm:10.0.1": version: 10.0.1 resolution: "mdast-util-to-hast@npm:10.0.1" @@ -25479,6 +25889,27 @@ __metadata: languageName: node linkType: hard +"mdast-util-to-markdown@npm:^0.6.0": + version: 0.6.5 + resolution: "mdast-util-to-markdown@npm:0.6.5" + dependencies: + "@types/unist": ^2.0.0 + longest-streak: ^2.0.0 + mdast-util-to-string: ^2.0.0 + parse-entities: ^2.0.0 + repeat-string: ^1.0.0 + zwitch: ^1.0.0 + checksum: 7ebc47533bff6e8669f85ae124dc521ea570e9df41c0d9e4f0f43c19ef4a8c9928d741f3e4afa62fcca1927479b714582ff5fd684ef240d84ee5b75ab9d863cf + languageName: node + linkType: hard + +"mdast-util-to-string@npm:2, mdast-util-to-string@npm:^2.0.0": + version: 2.0.0 + resolution: "mdast-util-to-string@npm:2.0.0" + checksum: 0b2113ada10e002fbccb014170506dabe2f2ddacaacbe4bc1045c33f986652c5a162732a2c057c5335cdb58419e2ad23e368e5be226855d4d4e280b81c4e9ec2 + languageName: node + linkType: hard + "mdast-util-to-string@npm:^1.0.0": version: 1.1.0 resolution: "mdast-util-to-string@npm:1.1.0" @@ -25796,6 +26227,16 @@ __metadata: languageName: node linkType: hard +"micromark@npm:~2.11.0": + version: 2.11.4 + resolution: "micromark@npm:2.11.4" + dependencies: + debug: ^4.0.0 + parse-entities: ^2.0.0 + checksum: f8a5477d394908a5d770227aea71657a76423d420227c67ea0699e659a5f62eb39d504c1f7d69ec525a6af5aaeb6a7bffcdba95614968c03d41d3851edecb0d6 + languageName: node + linkType: hard + "micromatch@npm:^3.0.4, micromatch@npm:^3.1.10, micromatch@npm:^3.1.4": version: 3.1.10 resolution: "micromatch@npm:3.1.10" @@ -31391,6 +31832,15 @@ __metadata: languageName: node linkType: hard +"remark-parse@npm:9": + version: 9.0.0 + resolution: "remark-parse@npm:9.0.0" + dependencies: + mdast-util-from-markdown: ^0.8.0 + checksum: 50104880549639b7dd7ae6f1e23c214915fe9c054f02f3328abdaee3f6de6d7282bf4357c3c5b106958fe75e644a3c248c2197755df34f9955e8e028fc74868f + languageName: node + linkType: hard + "remark-slug@npm:^6.0.0": version: 6.1.0 resolution: "remark-slug@npm:6.1.0" @@ -31411,6 +31861,15 @@ __metadata: languageName: node linkType: hard +"remark-stringify@npm:9": + version: 9.0.1 + resolution: "remark-stringify@npm:9.0.1" + dependencies: + mdast-util-to-markdown: ^0.6.0 + checksum: 93f46076f4d96ab1946d13e7dd43e83088480ac6b1dfe05a65e2c2f0e33d1f52a50175199b464a81803fc0f5b3bf182037665f89720b30515eba37bec4d63d56 + languageName: node + linkType: hard + "remove-accents@npm:0.4.2": version: 0.4.2 resolution: "remove-accents@npm:0.4.2" @@ -31465,7 +31924,7 @@ __metadata: languageName: node linkType: hard -"repeat-string@npm:^1.5.4, repeat-string@npm:^1.6.1": +"repeat-string@npm:^1.0.0, repeat-string@npm:^1.5.4, repeat-string@npm:^1.6.1": version: 1.6.1 resolution: "repeat-string@npm:1.6.1" checksum: 1b809fc6db97decdc68f5b12c4d1a671c8e3f65ec4a40c238bc5200e44e85bcc52a54f78268ab9c29fcf5fe4f1343e805420056d1f30fa9a9ee4c2d93e3cc6c0 @@ -32337,6 +32796,17 @@ __metadata: languageName: node linkType: hard +"semver@npm:^7.5.1": + version: 7.5.1 + resolution: "semver@npm:7.5.1" + dependencies: + lru-cache: ^6.0.0 + bin: + semver: bin/semver.js + checksum: d16dbedad53c65b086f79524b9ef766bf38670b2395bdad5c957f824dcc566b624988013564f4812bcace3f9d405355c3635e2007396a39d1bffc71cfec4a2fc + languageName: node + linkType: hard + "semver@npm:~5.3.0": version: 5.3.0 resolution: "semver@npm:5.3.0" @@ -35003,6 +35473,13 @@ __metadata: languageName: node linkType: hard +"tunnel@npm:^0.0.6": + version: 0.0.6 + resolution: "tunnel@npm:0.0.6" + checksum: c362948df9ad34b649b5585e54ce2838fa583aa3037091aaed66793c65b423a264e5229f0d7e9a95513a795ac2bd4cb72cda7e89a74313f182c1e9ae0b0994fa + languageName: node + linkType: hard + "turbo-darwin-64@npm:1.2.16": version: 1.2.16 resolution: "turbo-darwin-64@npm:1.2.16" @@ -35313,6 +35790,16 @@ __metadata: languageName: node linkType: hard +"typescript@npm:^5.1.3": + version: 5.1.3 + resolution: "typescript@npm:5.1.3" + bin: + tsc: bin/tsc + tsserver: bin/tsserver + checksum: d9d51862d98efa46534f2800a1071a613751b1585dc78884807d0c179bcd93d6e9d4012a508e276742f5f33c480adefc52ffcafaf9e0e00ab641a14cde9a31c7 + languageName: node + linkType: hard + "typescript@npm:~5.0.2": version: 5.0.2 resolution: "typescript@npm:5.0.2" @@ -35323,6 +35810,16 @@ __metadata: languageName: node linkType: hard +"typescript@patch:typescript@^5.1.3#~builtin": + version: 5.1.3 + resolution: "typescript@patch:typescript@npm%3A5.1.3#~builtin::version=5.1.3&hash=f456af" + bin: + tsc: bin/tsc + tsserver: bin/tsserver + checksum: 32a25b2e128a4616f999d4ee502aabb1525d5647bc8955e6edf05d7fbc53af8aa98252e2f6ba80bcedfc0260c982b885f3c09cfac8bb65d2924f3133ad1e1e62 + languageName: node + linkType: hard + "typescript@patch:typescript@~5.0.2#~builtin": version: 5.0.2 resolution: "typescript@patch:typescript@npm%3A5.0.2#~builtin::version=5.0.2&hash=f456af" @@ -35474,6 +35971,20 @@ __metadata: languageName: node linkType: hard +"unified@npm:9": + version: 9.2.2 + resolution: "unified@npm:9.2.2" + dependencies: + bail: ^1.0.0 + extend: ^3.0.0 + is-buffer: ^2.0.0 + is-plain-obj: ^2.0.0 + trough: ^1.0.0 + vfile: ^4.0.0 + checksum: 7c24461be7de4145939739ce50d18227c5fbdf9b3bc5a29dabb1ce26dd3e8bd4a1c385865f6f825f3b49230953ee8b591f23beab3bb3643e3e9dc37aa8a089d5 + languageName: node + linkType: hard + "unified@npm:9.2.0": version: 9.2.0 resolution: "unified@npm:9.2.0" @@ -35635,6 +36146,13 @@ __metadata: languageName: node linkType: hard +"universal-user-agent@npm:^6.0.0": + version: 6.0.0 + resolution: "universal-user-agent@npm:6.0.0" + checksum: 5092bbc80dd0d583cef0b62c17df0043193b74f425112ea6c1f69bc5eda21eeec7a08d8c4f793a277eb2202ffe9b44bec852fa3faff971234cd209874d1b79ef + languageName: node + linkType: hard + "universal-websocket-client@npm:^1.0.2": version: 1.0.2 resolution: "universal-websocket-client@npm:1.0.2"