Skip to content

Commit

Permalink
Merge pull request #41 from ckeditor/ci/3772
Browse files Browse the repository at this point in the history
Internal: Aligned to `ckeditor5-dev` ESM changes. Changelog for v7.1.1.
  • Loading branch information
pomek authored Oct 2, 2024
2 parents b40711e + 668607e commit e096d7f
Show file tree
Hide file tree
Showing 15 changed files with 120 additions and 129 deletions.
2 changes: 1 addition & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ jobs:
# Do not fail if the Node script ends with non-zero exit code.
set +e
node scripts/ci/is-project-ready-to-release.js
node scripts/ci/is-project-ready-to-release.mjs
EXIT_CODE=$( echo $? )
if [ ${EXIT_CODE} -eq 1 ];
Expand Down
4 changes: 4 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@

module.exports = {
extends: 'ckeditor5',
parserOptions: {
ecmaVersion: 'latest',
sourceType: 'module'
},
env: {
node: true
},
Expand Down
43 changes: 20 additions & 23 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,26 @@
Changelog
=========

## [7.1.1](https://github.com/ckeditor/ckeditor5-linters-config/compare/v7.1.0...v7.1.1) (2024-10-02)

Internal changes only (updated dependencies, documentation, etc.).

### 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:

* [eslint-config-ckeditor5](https://www.npmjs.com/package/eslint-config-ckeditor5/v/7.1.1): v7.1.0 => v7.1.1
* [eslint-plugin-ckeditor5-rules](https://www.npmjs.com/package/eslint-plugin-ckeditor5-rules/v/7.1.1): v7.1.0 => v7.1.1
* [stylelint-config-ckeditor5](https://www.npmjs.com/package/stylelint-config-ckeditor5/v/7.1.1): v7.1.0 => v7.1.1
* [stylelint-plugin-ckeditor5-rules](https://www.npmjs.com/package/stylelint-plugin-ckeditor5-rules/v/7.1.1): v7.1.0 => v7.1.1
</details>


## [7.1.0](https://github.com/ckeditor/ckeditor5-linters-config/compare/v7.0.0...v7.1.0) (2024-09-23)

### Features
Expand Down Expand Up @@ -106,29 +126,6 @@ Other releases:
* [stylelint-plugin-ckeditor5-rules](https://www.npmjs.com/package/stylelint-plugin-ckeditor5-rules/v/5.3.2): v5.3.1 => v5.3.2
</details>


## [5.3.1](https://github.com/ckeditor/ckeditor5-linters-config/compare/v5.3.0...v5.3.1) (2024-03-05)

### Bug fixes

* **[eslint-plugin-ckeditor5-rules](https://www.npmjs.com/package/eslint-plugin-ckeditor5-rules)**: Report a missing file extension when '.' import or export is used. Fixes [[#15880](https://github.com/ckeditor/ckeditor5-linters-config/issues/15880)](https://github.com/ckeditor/ckeditor5/issues/15880). ([commit](https://github.com/ckeditor/ckeditor5-linters-config/commit/be3159e8b3351b992586da62359b7806277fa3b4))
* **[eslint-plugin-ckeditor5-rules](https://www.npmjs.com/package/eslint-plugin-ckeditor5-rules)**: Properly detect valid imports of dependencies using the `exports` field. ([commit](https://github.com/ckeditor/ckeditor5-linters-config/commit/be3159e8b3351b992586da62359b7806277fa3b4))

### 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:

* [eslint-config-ckeditor5](https://www.npmjs.com/package/eslint-config-ckeditor5/v/5.3.1): v5.3.0 => v5.3.1
* [eslint-plugin-ckeditor5-rules](https://www.npmjs.com/package/eslint-plugin-ckeditor5-rules/v/5.3.1): v5.3.0 => v5.3.1
* [stylelint-config-ckeditor5](https://www.npmjs.com/package/stylelint-config-ckeditor5/v/5.3.1): v5.3.0 => v5.3.1
* [stylelint-plugin-ckeditor5-rules](https://www.npmjs.com/package/stylelint-plugin-ckeditor5-rules/v/5.3.1): v5.3.0 => v5.3.1
</details>

---

To see all releases, visit the [release page](https://github.com/ckeditor/ckeditor5-linters-config/releases).
26 changes: 11 additions & 15 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@
"private": true,
"scripts": {
"postinstall": "node ./scripts/postinstall.js",
"lint": "eslint --quiet \"**/*.js\"",
"lint": "eslint --quiet \"**/*.{js,mjs}\"",
"precommit": "lint-staged",
"changelog": "node ./scripts/changelog.js",
"release:prepare-packages": "node ./scripts/preparepackages.js",
"release:publish-packages": "node ./scripts/publishpackages.js",
"changelog": "node ./scripts/changelog.mjs",
"release:prepare-packages": "node ./scripts/preparepackages.mjs",
"release:publish-packages": "node ./scripts/publishpackages.mjs",
"test": "node ./scripts/test-packages.js",
"clean": "npx rimraf package-lock.json yarn.lock ./**/node_modules",
"reinstall": "yarn run clean && yarn install"
Expand All @@ -29,20 +29,16 @@
"url": "https://github.com/ckeditor/ckeditor5-linters-config.git"
},
"devDependencies": {
"@ckeditor/ckeditor5-dev-bump-year": "^42.0.0",
"@ckeditor/ckeditor5-dev-ci": "^42.0.0",
"@ckeditor/ckeditor5-dev-release-tools": "^42.0.0",
"eslint": "^7.0.0",
"@ckeditor/ckeditor5-dev-bump-year": "^44.0.0",
"@ckeditor/ckeditor5-dev-ci": "^44.0.0",
"@ckeditor/ckeditor5-dev-release-tools": "^44.0.0",
"eslint": "^8.21.0",
"husky": "^8.0.2",
"lint-staged": "^13.0.0",
"listr2": "^6.5.0"
},
"resolutions": {
"string-width": "^4.0.0",
"wrap-ansi": "^7.0.0"
"lint-staged": "^15.0.0",
"listr2": "^8.0.0"
},
"lint-staged": {
"**/*.js": [
"**/*.{js,mjs}": [
"eslint --quiet"
]
},
Expand Down
2 changes: 1 addition & 1 deletion packages/eslint-plugin-ckeditor5-rules/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
"devDependencies": {
"eslint": "^7.0.0",
"eslint-config-ckeditor5": "^7.1.0",
"glob": "^10.2.5",
"glob": "^10.0.0",
"lodash": "^4.17.21"
},
"peerDependencies": {
Expand Down
45 changes: 0 additions & 45 deletions scripts/bump-year.js

This file was deleted.

46 changes: 46 additions & 0 deletions scripts/bump-year.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
#!/usr/bin/env node

/**
* @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
* For licensing, see LICENSE.md.
*/

/* eslint-env node */

/*
Usage:
node scripts/bump-year.mjs
And after reviewing the changes:
git commit -am "Internal: Bumped the year." && git push
*/

import { bumpYear } from '@ckeditor/ckeditor5-dev-bump-year';

bumpYear( {
cwd: process.cwd(),
globPatterns: [
{ // LICENSE.md, .eslintrc.js, etc.
pattern: '*',
options: {
dot: true
}
},
{
pattern: '.husky/*'
},
{
pattern: '!(coverage|.nyc_output)/**',
options: {
ignore: [
'**/tests/fixtures/**'
]
}
},
{
pattern: 'packages/*/.eslintrc.js'
}
]
} );
6 changes: 2 additions & 4 deletions scripts/changelog.js → scripts/changelog.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,8 @@
* For licensing, see LICENSE.md.
*/

'use strict';

const { generateChangelogForMonoRepository } = require( '@ckeditor/ckeditor5-dev-release-tools' );
const parseArguments = require( './utils/parsearguments' );
import { generateChangelogForMonoRepository } from '@ckeditor/ckeditor5-dev-release-tools';
import parseArguments from './utils/parsearguments.mjs';

const cliArguments = parseArguments( process.argv.slice( 2 ) );

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,10 @@

/* eslint-env node */

'use strict';
import { createRequire } from 'module';
import * as releaseTools from '@ckeditor/ckeditor5-dev-release-tools';

const releaseTools = require( '@ckeditor/ckeditor5-dev-release-tools' );
const require = createRequire( import.meta.url );
const { name: packageName } = require( '../../packages/eslint-config-ckeditor5/package.json' );

const changelogVersion = releaseTools.getLastFromChangelog();
Expand Down
14 changes: 6 additions & 8 deletions scripts/preparepackages.js → scripts/preparepackages.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,12 @@

/* eslint-env node */

'use strict';

const { Listr } = require( 'listr2' );
const releaseTools = require( '@ckeditor/ckeditor5-dev-release-tools' );
const isMonoRepositoryDependency = require( './utils/ismonorepositorydependency' );
const parseArguments = require( './utils/parsearguments' );
const getListrOptions = require( './utils/getlistroptions' );
const { PACKAGES_DIRECTORY, RELEASE_DIRECTORY } = require( './utils/constants' );
import { Listr } from 'listr2';
import * as releaseTools from '@ckeditor/ckeditor5-dev-release-tools';
import parseArguments from './utils/parsearguments.mjs';
import getListrOptions from './utils/getlistroptions.mjs';
import isMonoRepositoryDependency from './utils/ismonorepositorydependency.mjs';
import { PACKAGES_DIRECTORY, RELEASE_DIRECTORY } from './utils/constants.mjs';

const cliArguments = parseArguments( process.argv.slice( 2 ) );
const latestVersion = releaseTools.getLastFromChangelog();
Expand Down
15 changes: 6 additions & 9 deletions scripts/publishpackages.js → scripts/publishpackages.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,11 @@

/* eslint-env node */

'use strict';

const { Listr } = require( 'listr2' );
const releaseTools = require( '@ckeditor/ckeditor5-dev-release-tools' );
const { provideToken } = require( '@ckeditor/ckeditor5-dev-release-tools/lib/utils/cli' );
const parseArguments = require( './utils/parsearguments' );
const getListrOptions = require( './utils/getlistroptions' );
const { RELEASE_DIRECTORY } = require( './utils/constants' );
import { Listr } from 'listr2';
import * as releaseTools from '@ckeditor/ckeditor5-dev-release-tools';
import parseArguments from './utils/parsearguments.mjs';
import getListrOptions from './utils/getlistroptions.mjs';
import { RELEASE_DIRECTORY } from './utils/constants.mjs';

const cliArguments = parseArguments( process.argv.slice( 2 ) );
const latestVersion = releaseTools.getLastFromChangelog();
Expand Down Expand Up @@ -92,7 +89,7 @@ const tasks = new Listr( [
if ( process.env.CKE5_RELEASE_TOKEN ) {
githubToken = process.env.CKE5_RELEASE_TOKEN;
} else {
githubToken = await provideToken();
githubToken = await releaseTools.provideToken();
}

await tasks.run();
Expand Down
6 changes: 2 additions & 4 deletions scripts/utils/constants.js → scripts/utils/constants.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,5 @@
* For licensing, see LICENSE.md.
*/

module.exports = {
PACKAGES_DIRECTORY: 'packages',
RELEASE_DIRECTORY: 'release'
};
export const PACKAGES_DIRECTORY = 'packages';
export const RELEASE_DIRECTORY = 'release';
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,12 @@

/* eslint-env node */

'use strict';

/**
* @param {ReleaseOptions} cliArguments
* @returns {Object}
*/
module.exports = function getListrOptions( cliArguments ) {
export default function getListrOptions( cliArguments ) {
return {
renderer: cliArguments.verbose ? 'verbose' : 'default'
};
};
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,22 @@

/* eslint-env node */

const fs = require( 'fs' );
const path = require( 'path' );
import fs from 'fs';
import path from 'path';
import { fileURLToPath } from 'url';
import { PACKAGES_DIRECTORY } from './constants.mjs';

const __filename = fileURLToPath( import.meta.url );
const __dirname = path.dirname( __filename );

const { PACKAGES_DIRECTORY } = require( './constants' );
const ROOT_DIRECTORY = path.join( __dirname, '..', '..' );
const PACKAGES_PATH = path.join( ROOT_DIRECTORY, PACKAGES_DIRECTORY );

// Name of available packages in the `packages/` directory.
const AVAILABLE_PACKAGES = fs.readdirSync( PACKAGES_PATH )
.map( directoryName => {
const packagePath = path.join( PACKAGES_PATH, directoryName );
const packageJson = require( path.join( packagePath, 'package.json' ) );
const packageJsonPath = path.join( PACKAGES_PATH, directoryName, 'package.json' );
const packageJson = JSON.parse( fs.readFileSync( packageJsonPath, { encoding: 'utf-8' } ) );

return packageJson.name;
} );
Expand All @@ -25,6 +29,6 @@ const AVAILABLE_PACKAGES = fs.readdirSync( PACKAGES_PATH )
* @param {String} packageName
* @returns {Boolean}
*/
module.exports = function isValidDependency( packageName ) {
export default function isValidDependency( packageName ) {
return AVAILABLE_PACKAGES.includes( packageName );
};
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,14 @@

/* eslint-env node */

'use strict';

const minimist = require( 'minimist' );
import os from 'os';
import minimist from 'minimist';

/**
* @param {Array.<String>} cliArguments
* @returns {ReleaseOptions} options
*/
module.exports = function parseArguments( cliArguments ) {
export default function parseArguments( cliArguments ) {
const config = {
boolean: [
'verbose',
Expand All @@ -33,7 +32,7 @@ module.exports = function parseArguments( cliArguments ) {
],

default: {
concurrency: require( 'os' ).cpus().length / 2,
concurrency: os.cpus().length / 2,
packages: null,
ci: false,
verbose: false,
Expand All @@ -60,7 +59,7 @@ module.exports = function parseArguments( cliArguments ) {
}

return options;
};
}

/**
* @typedef {Object} ReleaseOptions
Expand Down

0 comments on commit e096d7f

Please sign in to comment.