Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Changelog for v44.1.0 (as next) #1023

Merged
merged 5 commits into from
Oct 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .circleci/template.yml
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ jobs:
command: npm run release:prepare-packages -- --verbose
- run:
name: Publish the packages
command: npm run release:publish-packages -- --verbose
command: npm run release:publish-packages -- --verbose --npm-tag next
- run:
name: Enable the redundant workflows option
command: yarn ckeditor5-dev-ci-circle-enable-auto-cancel-builds
Expand Down
81 changes: 48 additions & 33 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,54 @@
Changelog
=========

## [44.1.0](https://github.com/ckeditor/ckeditor5-dev/compare/v44.0.0...v44.1.0) (2024-10-15)

> [!NOTE]
> The release channel for this release is `next`.

### Features

* **[ci](https://www.npmjs.com/package/@ckeditor/ckeditor5-dev-ci)**: Created a new binary script called `ckeditor5-dev-ci-is-workflow-restarted` that returns with a non-zero exit code if a given workflow is executed for the first time. The restarted workflows exit with a zero exit code. ([commit](https://github.com/ckeditor/ckeditor5-dev/commit/ff7d7387cc46fc24d7992178f331f29df50f7e53))
* **[release-tools](https://www.npmjs.com/package/@ckeditor/ckeditor5-dev-release-tools)**: A user-provided version will be checked against npm availability while generating a changelog. If it is already taken, the tools will not allow it to be used. ([commit](https://github.com/ckeditor/ckeditor5-dev/commit/ff7d7387cc46fc24d7992178f331f29df50f7e53))

### Other changes

* **[release-tools](https://www.npmjs.com/package/@ckeditor/ckeditor5-dev-release-tools)**: The `updateVersions()` task will no longer verify if the specified `version` is available on npm. ([commit](https://github.com/ckeditor/ckeditor5-dev/commit/ff7d7387cc46fc24d7992178f331f29df50f7e53))
* **[release-tools](https://www.npmjs.com/package/@ckeditor/ckeditor5-dev-release-tools)**: The `publishPackages()` task filters out already published packages to avoid pushing the same archive twice. Thanks to that, it can be a part of a process that would be restarted. ([commit](https://github.com/ckeditor/ckeditor5-dev/commit/ff7d7387cc46fc24d7992178f331f29df50f7e53))
* **[release-tools](https://www.npmjs.com/package/@ckeditor/ckeditor5-dev-release-tools)**: The `publishPackages()` task tries to publish the package once again when it fails independently of the returned error code. Previously, it was scheduled only when the `E409` error occurred. ([commit](https://github.com/ckeditor/ckeditor5-dev/commit/ff7d7387cc46fc24d7992178f331f29df50f7e53))
* **[release-tools](https://www.npmjs.com/package/@ckeditor/ckeditor5-dev-release-tools)**: Marked the `verifyPackagesPublishedCorrectly()` function is deprecated. Its responsibility has been merged with `publishPackages()`. ([commit](https://github.com/ckeditor/ckeditor5-dev/commit/ff7d7387cc46fc24d7992178f331f29df50f7e53))
* **[release-tools](https://www.npmjs.com/package/@ckeditor/ckeditor5-dev-release-tools)**: The `commitAndTag()` task does not commit files if a tag for the specified version is already created. ([commit](https://github.com/ckeditor/ckeditor5-dev/commit/ff7d7387cc46fc24d7992178f331f29df50f7e53))
* **[release-tools](https://www.npmjs.com/package/@ckeditor/ckeditor5-dev-release-tools)**: We do not spawn an npm process to download a package manifest from the npm registry. Instead, we send an HTTP request using the `pacote` package. Closes [ckeditor/ckeditor5#17191](https://github.com/ckeditor/ckeditor5/issues/17191). ([commit](https://github.com/ckeditor/ckeditor5-dev/commit/a155390a2ee45190ce6edc49ed48f8e871aa641f))
* **[release-tools](https://www.npmjs.com/package/@ckeditor/ckeditor5-dev-release-tools)**: The `getNpmTagFromVersion()` function returns a `'nightly'` string when passing a CKEditor 5 nightly version. ([commit](https://github.com/ckeditor/ckeditor5-dev/commit/4edf71cade5c73a8f9a7dbf80994490eeb400b60))

### Released packages

Check out the [Versioning policy](https://ckeditor.com/docs/ckeditor5/latest/framework/guides/support/versioning-policy.html) guide for more information.

<details>
<summary>Released packages (summary)</summary>

Releases containing new features:

* [@ckeditor/ckeditor5-dev-ci](https://www.npmjs.com/package/@ckeditor/ckeditor5-dev-ci/v/44.1.0): v44.0.0 => v44.1.0
* [@ckeditor/ckeditor5-dev-release-tools](https://www.npmjs.com/package/@ckeditor/ckeditor5-dev-release-tools/v/44.1.0): v44.0.0 => v44.1.0

Other releases:

* [@ckeditor/ckeditor5-dev-build-tools](https://www.npmjs.com/package/@ckeditor/ckeditor5-dev-build-tools/v/44.1.0): v44.0.0 => v44.1.0
* [@ckeditor/ckeditor5-dev-bump-year](https://www.npmjs.com/package/@ckeditor/ckeditor5-dev-bump-year/v/44.1.0): v44.0.0 => v44.1.0
* [@ckeditor/ckeditor5-dev-dependency-checker](https://www.npmjs.com/package/@ckeditor/ckeditor5-dev-dependency-checker/v/44.1.0): v44.0.0 => v44.1.0
* [@ckeditor/ckeditor5-dev-docs](https://www.npmjs.com/package/@ckeditor/ckeditor5-dev-docs/v/44.1.0): v44.0.0 => v44.1.0
* [@ckeditor/ckeditor5-dev-stale-bot](https://www.npmjs.com/package/@ckeditor/ckeditor5-dev-stale-bot/v/44.1.0): v44.0.0 => v44.1.0
* [@ckeditor/ckeditor5-dev-tests](https://www.npmjs.com/package/@ckeditor/ckeditor5-dev-tests/v/44.1.0): v44.0.0 => v44.1.0
* [@ckeditor/ckeditor5-dev-transifex](https://www.npmjs.com/package/@ckeditor/ckeditor5-dev-transifex/v/44.1.0): v44.0.0 => v44.1.0
* [@ckeditor/ckeditor5-dev-translations](https://www.npmjs.com/package/@ckeditor/ckeditor5-dev-translations/v/44.1.0): v44.0.0 => v44.1.0
* [@ckeditor/ckeditor5-dev-utils](https://www.npmjs.com/package/@ckeditor/ckeditor5-dev-utils/v/44.1.0): v44.0.0 => v44.1.0
* [@ckeditor/ckeditor5-dev-web-crawler](https://www.npmjs.com/package/@ckeditor/ckeditor5-dev-web-crawler/v/44.1.0): v44.0.0 => v44.1.0
* [@ckeditor/typedoc-plugins](https://www.npmjs.com/package/@ckeditor/typedoc-plugins/v/44.1.0): v44.0.0 => v44.1.0
</details>


## [44.0.0](https://github.com/ckeditor/ckeditor5-dev/compare/v43.0.0...v44.0.0) (2024-10-02)

### MAJOR BREAKING CHANGES [ℹ️](https://ckeditor.com/docs/ckeditor5/latest/framework/guides/support/versioning-policy.html#major-and-minor-breaking-changes)
Expand Down Expand Up @@ -157,39 +205,6 @@ Other releases:
* [@ckeditor/typedoc-plugins](https://www.npmjs.com/package/@ckeditor/typedoc-plugins/v/44.0.0-alpha.3): v44.0.0-alpha.2 => v44.0.0-alpha.3
</details>


## [44.0.0-alpha.2](https://github.com/ckeditor/ckeditor5-dev/compare/v44.0.0-alpha.1...v44.0.0-alpha.2) (2024-09-23)

### Other changes

* **[docs](https://www.npmjs.com/package/@ckeditor/ckeditor5-dev-docs)**: Support for passing an array of files to ignore when preparing API. ([commit](https://github.com/ckeditor/ckeditor5-dev/commit/3c858289a5826c9fceddfb380a4e35d48b44a099))
* **[tests](https://www.npmjs.com/package/@ckeditor/ckeditor5-dev-tests)**: Restored the previous version of Chai and sinon-chai packages due to issues with processing ESM in Karma. ([commit](https://github.com/ckeditor/ckeditor5-dev/commit/833ac929e4193b6791c79cdc5df05e67539c0c7f))
* Use the "2021" edition as a default preset for CKEditor 5 files (`postcss-nesting`). ([commit](https://github.com/ckeditor/ckeditor5-dev/commit/ce3902d5855f1b3ba886dea1db195a5b27e22026))

### Released packages

Check out the [Versioning policy](https://ckeditor.com/docs/ckeditor5/latest/framework/guides/support/versioning-policy.html) guide for more information.

<details>
<summary>Released packages (summary)</summary>

Other releases:

* [@ckeditor/ckeditor5-dev-build-tools](https://www.npmjs.com/package/@ckeditor/ckeditor5-dev-build-tools/v/44.0.0-alpha.2): v44.0.0-alpha.1 => v44.0.0-alpha.2
* [@ckeditor/ckeditor5-dev-bump-year](https://www.npmjs.com/package/@ckeditor/ckeditor5-dev-bump-year/v/44.0.0-alpha.2): v44.0.0-alpha.1 => v44.0.0-alpha.2
* [@ckeditor/ckeditor5-dev-ci](https://www.npmjs.com/package/@ckeditor/ckeditor5-dev-ci/v/44.0.0-alpha.2): v44.0.0-alpha.1 => v44.0.0-alpha.2
* [@ckeditor/ckeditor5-dev-dependency-checker](https://www.npmjs.com/package/@ckeditor/ckeditor5-dev-dependency-checker/v/44.0.0-alpha.2): v44.0.0-alpha.1 => v44.0.0-alpha.2
* [@ckeditor/ckeditor5-dev-docs](https://www.npmjs.com/package/@ckeditor/ckeditor5-dev-docs/v/44.0.0-alpha.2): v44.0.0-alpha.1 => v44.0.0-alpha.2
* [@ckeditor/ckeditor5-dev-release-tools](https://www.npmjs.com/package/@ckeditor/ckeditor5-dev-release-tools/v/44.0.0-alpha.2): v44.0.0-alpha.1 => v44.0.0-alpha.2
* [@ckeditor/ckeditor5-dev-stale-bot](https://www.npmjs.com/package/@ckeditor/ckeditor5-dev-stale-bot/v/44.0.0-alpha.2): v44.0.0-alpha.1 => v44.0.0-alpha.2
* [@ckeditor/ckeditor5-dev-tests](https://www.npmjs.com/package/@ckeditor/ckeditor5-dev-tests/v/44.0.0-alpha.2): v44.0.0-alpha.1 => v44.0.0-alpha.2
* [@ckeditor/ckeditor5-dev-transifex](https://www.npmjs.com/package/@ckeditor/ckeditor5-dev-transifex/v/44.0.0-alpha.2): v44.0.0-alpha.1 => v44.0.0-alpha.2
* [@ckeditor/ckeditor5-dev-translations](https://www.npmjs.com/package/@ckeditor/ckeditor5-dev-translations/v/44.0.0-alpha.2): v44.0.0-alpha.1 => v44.0.0-alpha.2
* [@ckeditor/ckeditor5-dev-utils](https://www.npmjs.com/package/@ckeditor/ckeditor5-dev-utils/v/44.0.0-alpha.2): v44.0.0-alpha.1 => v44.0.0-alpha.2
* [@ckeditor/ckeditor5-dev-web-crawler](https://www.npmjs.com/package/@ckeditor/ckeditor5-dev-web-crawler/v/44.0.0-alpha.2): v44.0.0-alpha.1 => v44.0.0-alpha.2
* [@ckeditor/typedoc-plugins](https://www.npmjs.com/package/@ckeditor/typedoc-plugins/v/44.0.0-alpha.2): v44.0.0-alpha.1 => v44.0.0-alpha.2
</details>

---

To see all releases, visit the [release page](https://github.com/ckeditor/ckeditor5-dev/releases).
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
*/

import { Octokit } from '@octokit/rest';
import semver from 'semver';
import * as transformCommitUtils from '../utils/transformcommitutils.js';
import getNpmTagFromVersion from '../utils/getnpmtagfromversion.js';

const { getRepositoryUrl } = transformCommitUtils;

Expand Down Expand Up @@ -41,25 +41,13 @@ export default async function createGithubRelease( options ) {
owner: repositoryOwner,
repo: repositoryName,
body: description,
prerelease: getVersionTag( version ) !== 'latest'
prerelease: getNpmTagFromVersion( version ) !== 'latest'
} );
}

return `https://github.com/${ repositoryOwner }/${ repositoryName }/releases/tag/v${ version }`;
}

/**
* Returns an npm tag based on the specified release version.
*
* @param {string} version
* @returns {string}
*/
function getVersionTag( version ) {
const [ versionTag ] = semver.prerelease( version ) || [ 'latest' ];

return versionTag;
}

/**
* Resolves a promise containing a flag if the GitHub contains the release page for given version.
*
Expand Down
30 changes: 8 additions & 22 deletions packages/ckeditor5-dev-release-tools/lib/utils/assertnpmtag.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,12 @@

import fs from 'fs-extra';
import upath from 'upath';
import semver from 'semver';
import getNpmTagFromVersion from './getnpmtagfromversion.js';

const ALLOWED_NPM_LATEST_TAGS = [
'staging',
'next'
];

/**
* Checks if the npm tag matches the tag calculated from the package version. Verification takes place for all packages.
Expand All @@ -20,13 +25,13 @@ export default async function assertNpmTag( packagePaths, npmTag ) {
for ( const packagePath of packagePaths ) {
const packageJsonPath = upath.join( packagePath, 'package.json' );
const packageJson = await fs.readJson( packageJsonPath );
const versionTag = getVersionTag( packageJson.version );
const versionTag = getNpmTagFromVersion( packageJson.version );

if ( versionTag === npmTag ) {
continue;
}

if ( versionTag === 'latest' && npmTag === 'staging' ) {
if ( versionTag === 'latest' && ALLOWED_NPM_LATEST_TAGS.includes( npmTag ) ) {
continue;
}

Expand All @@ -37,22 +42,3 @@ export default async function assertNpmTag( packagePaths, npmTag ) {
throw new Error( errors.join( '\n' ) );
}
}

/**
* Returns the version tag for the package.
*
* For the official release, returns the "latest" tag. For a non-official release (pre-release), returns the version tag extracted from
* the package version.
*
* @param {string} version
* @returns {string}
*/
function getVersionTag( version ) {
const [ versionTag ] = semver.prerelease( version ) || [ 'latest' ];

if ( versionTag.startsWith( 'nightly' ) ) {
return 'nightly';
}

return versionTag;
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,20 @@
import semver from 'semver';

/**
* Returns a version tag from specified `version`.
*
* For the official release, returns the "latest" tag. For a non-official release (pre-release),
* returns the version tag extracted from the passed version.
*
* @param {string} version
* @returns {string}
*/
export default function getNpmTagFromVersion( version ) {
const [ versionTag ] = semver.prerelease( version ) || [ 'latest' ];

if ( versionTag.startsWith( 'nightly' ) ) {
return 'nightly';
}

return versionTag;
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@

import { beforeEach, describe, expect, it, vi } from 'vitest';
import createGithubRelease from '../../lib/tasks/creategithubrelease.js';
import getNpmTagFromVersion from '../../lib/utils/getnpmtagfromversion.js';
import * as transformCommitUtils from '../../lib/utils/transformcommitutils.js';

const stubs = vi.hoisted( () => ( {
Expand All @@ -27,6 +28,7 @@ vi.mock( '@octokit/rest', () => ( {
} ) );

vi.mock( '../../lib/utils/transformcommitutils.js' );
vi.mock( '../../lib/utils/getnpmtagfromversion.js' );

describe( 'createGithubRelease()', () => {
let options;
Expand All @@ -43,6 +45,7 @@ describe( 'createGithubRelease()', () => {
stubs.getLatestRelease.mockRejectedValue( { status: 404 } );
stubs.createRelease.mockResolvedValue();

vi.mocked( getNpmTagFromVersion ).mockReturnValue( 'latest' );
vi.mocked( transformCommitUtils.getRepositoryUrl ).mockReturnValue( 'https://github.com/ckeditor/ckeditor5-dev' );
} );

Expand Down Expand Up @@ -80,6 +83,8 @@ describe( 'createGithubRelease()', () => {
} );

it( 'creates a prerelease page when passing a major.minor.patch-prerelease version', async () => {
vi.mocked( getNpmTagFromVersion ).mockReturnValue( 'alpha' );

options.version = '1.3.5-alpha.0';
await createGithubRelease( options );

Expand Down
71 changes: 65 additions & 6 deletions packages/ckeditor5-dev-release-tools/tests/utils/assertnpmtag.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,19 @@
* For licensing, see LICENSE.md.
*/

import { describe, expect, it, vi } from 'vitest';
import { beforeEach, describe, expect, it, vi } from 'vitest';
import fs from 'fs-extra';
import assertNpmTag from '../../lib/utils/assertnpmtag.js';
import getNpmTagFromVersion from '../../lib/utils/getnpmtagfromversion.js';

vi.mock( 'fs-extra' );
vi.mock( '../../lib/utils/getnpmtagfromversion.js' );

describe( 'assertNpmTag()', () => {
beforeEach( () => {
vi.mocked( getNpmTagFromVersion ).mockReturnValue( 'latest' );
} );

it( 'should resolve the promise if list of packages is empty', async () => {
await assertNpmTag( [] );
} );
Expand Down Expand Up @@ -45,7 +51,7 @@ describe( 'assertNpmTag()', () => {
await assertNpmTag( [ 'ckeditor5-foo' ], 'latest' );
} );

it( 'should not throw if version tag matches npm tag (version tag = "latest", npm tag = "staging")', async () => {
it( 'should not throw if version tag (latest) matches npm tag (staging)', async () => {
vi.mocked( fs ).readJson.mockResolvedValue( {
name: 'ckeditor5-foo',
version: '1.0.0'
Expand All @@ -54,7 +60,18 @@ describe( 'assertNpmTag()', () => {
await assertNpmTag( [ 'ckeditor5-foo' ], 'staging' );
} );

it( 'should not throw if version tag (latest) matches npm tag (next)', async () => {
vi.mocked( fs ).readJson.mockResolvedValue( {
name: 'ckeditor5-foo',
version: '1.0.0'
} );

await assertNpmTag( [ 'ckeditor5-foo' ], 'next' );
} );

it( 'should not throw if version tag matches npm tag (both "alpha")', async () => {
vi.mocked( getNpmTagFromVersion ).mockReturnValue( 'alpha' );

vi.mocked( fs ).readJson.mockResolvedValue( {
name: 'ckeditor5-foo',
version: '1.0.0-alpha.0'
Expand All @@ -64,6 +81,8 @@ describe( 'assertNpmTag()', () => {
} );

it( 'should not throw if version tag matches npm tag (both "nightly")', async () => {
vi.mocked( getNpmTagFromVersion ).mockReturnValue( 'nightly' );

vi.mocked( fs ).readJson.mockResolvedValue( {
name: 'ckeditor5-foo',
version: '0.0.0-nightly-20230517.0'
Expand All @@ -72,7 +91,7 @@ describe( 'assertNpmTag()', () => {
await assertNpmTag( [ 'ckeditor5-foo' ], 'nightly' );
} );

it( 'should throw if version tag does not match npm tag (version tag = "latest", npm tag = "alpha")', async () => {
it( 'should throw if version tag (latest) does not match npm tag (alpha)', async () => {
vi.mocked( fs ).readJson.mockResolvedValue( {
name: 'ckeditor5-foo',
version: '1.0.0'
Expand All @@ -82,7 +101,7 @@ describe( 'assertNpmTag()', () => {
.rejects.toThrow( 'The version tag "latest" from "ckeditor5-foo" package does not match the npm tag "alpha".' );
} );

it( 'should throw if version tag does not match npm tag (version tag = "latest", npm tag = "nightly")', async () => {
it( 'should throw if version (latest) tag does not match npm tag (nightly)', async () => {
vi.mocked( fs ).readJson.mockResolvedValue( {
name: 'ckeditor5-foo',
version: '1.0.0'
Expand All @@ -92,7 +111,9 @@ describe( 'assertNpmTag()', () => {
.rejects.toThrow( 'The version tag "latest" from "ckeditor5-foo" package does not match the npm tag "nightly".' );
} );

it( 'should throw if version tag does not match npm tag (version tag = "alpha", npm tag = "staging")', async () => {
it( 'should throw if version tag (alpha) does not match npm tag (staging)', async () => {
vi.mocked( getNpmTagFromVersion ).mockReturnValue( 'alpha' );

vi.mocked( fs ).readJson.mockResolvedValue( {
name: 'ckeditor5-foo',
version: '1.0.0-alpha.0'
Expand All @@ -102,7 +123,9 @@ describe( 'assertNpmTag()', () => {
.rejects.toThrow( 'The version tag "alpha" from "ckeditor5-foo" package does not match the npm tag "staging".' );
} );

it( 'should throw if version tag does not match npm tag (version tag = "nightly", npm tag = "staging")', async () => {
it( 'should throw if version tag (nightly) does not match npm tag (staging)', async () => {
vi.mocked( getNpmTagFromVersion ).mockReturnValue( 'nightly' );

vi.mocked( fs ).readJson.mockResolvedValue( {
name: 'ckeditor5-foo',
version: '0.0.0-nightly-20230517.0'
Expand All @@ -112,7 +135,43 @@ describe( 'assertNpmTag()', () => {
.rejects.toThrow( 'The version tag "nightly" from "ckeditor5-foo" package does not match the npm tag "staging".' );
} );

it( 'should throw if version tag (alpha) does not match npm tag (next)', async () => {
vi.mocked( getNpmTagFromVersion ).mockReturnValue( 'alpha' );

vi.mocked( fs ).readJson.mockResolvedValue( {
name: 'ckeditor5-foo',
version: '1.0.0-alpha.0'
} );

await expect( assertNpmTag( [ 'ckeditor5-foo' ], 'next' ) )
.rejects.toThrow( 'The version tag "alpha" from "ckeditor5-foo" package does not match the npm tag "next".' );
} );

it( 'should throw if version tag (nightly) does not match npm tag (next)', async () => {
vi.mocked( getNpmTagFromVersion ).mockReturnValue( 'nightly' );

vi.mocked( fs ).readJson.mockResolvedValue( {
name: 'ckeditor5-foo',
version: '0.0.0-nightly-20230517.0'
} );

await expect( assertNpmTag( [ 'ckeditor5-foo' ], 'next' ) )
.rejects.toThrow( 'The version tag "nightly" from "ckeditor5-foo" package does not match the npm tag "next".' );
} );

it( 'should throw one error for all packages with incorrect tags', async () => {
vi.mocked( getNpmTagFromVersion ).mockImplementation( input => {
if ( input === '1.0.0-alpha' ) {
return 'alpha';
}
if ( input === '0.0.0-nightly-20230517.0' ) {
return 'nightly';
}
if ( input === '0.0.1-rc.5' ) {
return 'rc';
}
} );

vi.mocked( fs ).readJson.mockImplementation( input => {
if ( input === 'ckeditor5-foo/package.json' ) {
return Promise.resolve( {
Expand Down
Loading