Skip to content

Commit

Permalink
Merge pull request #171 from cksource/ci/3772
Browse files Browse the repository at this point in the history
Internal: Aligned to ckeditor5-dev ESM changes.
  • Loading branch information
pomek authored Oct 3, 2024
2 parents d681352 + 122d2bf commit c156bee
Show file tree
Hide file tree
Showing 8 changed files with 1,544 additions and 1,634 deletions.
16 changes: 8 additions & 8 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,9 @@
"upath": "^2.0.0"
},
"devDependencies": {
"@ckeditor/ckeditor5-dev-bump-year": "^39.0.0",
"@ckeditor/ckeditor5-dev-ci": "^39.0.0",
"@ckeditor/ckeditor5-dev-release-tools": "^39.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",
"coveralls": "^3.1.1",
"chai": "^4.2.0",
"eslint": "^7.7.0",
Expand Down Expand Up @@ -61,10 +61,10 @@
"postinstall": "node ./scripts/postinstall.js",
"test": "mocha tests --recursive",
"coverage": "nyc --reporter=lcov --reporter=text-summary yarn run test",
"lint": "eslint --quiet \"**/*.js\"",
"changelog": "node ./scripts/changelog.js",
"release:prepare-packages": "node ./scripts/preparepackages.js",
"release:publish-packages": "node ./scripts/publishpackages.js"
"lint": "eslint --quiet \"**/*.{js,mjs}\"",
"changelog": "node ./scripts/changelog.mjs",
"release:prepare-packages": "node ./scripts/preparepackages.mjs",
"release:publish-packages": "node ./scripts/publishpackages.mjs"
},
"bin": {
"mrgit": "./index.js"
Expand All @@ -76,7 +76,7 @@
"CHANGELOG.md"
],
"lint-staged": {
"**/*.js": [
"**/*.{js,mjs}": [
"eslint --quiet"
]
}
Expand Down
37 changes: 0 additions & 37 deletions scripts/bump-year.js

This file was deleted.

38 changes: 38 additions & 0 deletions scripts/bump-year.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
#!/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)/**'
}
]
} );
4 changes: 2 additions & 2 deletions scripts/changelog.js → scripts/changelog.mjs
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@
* For licensing, see LICENSE.md.
*/

'use strict';
import { generateChangelogForSinglePackage } from '@ckeditor/ckeditor5-dev-release-tools';

require( '@ckeditor/ckeditor5-dev-release-tools' ).generateChangelogForSinglePackage();
generateChangelogForSinglePackage();
7 changes: 4 additions & 3 deletions scripts/preparepackages.js → scripts/preparepackages.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,11 @@

/* eslint-env node */

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

const { Listr } = require( 'listr2' );
const releaseTools = require( '@ckeditor/ckeditor5-dev-release-tools' );
const require = createRequire( import.meta.url );

const latestVersion = releaseTools.getLastFromChangelog();
const versionChangelog = releaseTools.getChangesForVersion( latestVersion );
Expand Down
11 changes: 4 additions & 7 deletions scripts/publishpackages.js → scripts/publishpackages.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,9 @@

/* 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' );
import { Listr } from 'listr2';
import * as releaseTools from '@ckeditor/ckeditor5-dev-release-tools';
import parseArguments from './utils/parsearguments.mjs';

const cliArguments = parseArguments( process.argv.slice( 2 ) );
const latestVersion = releaseTools.getLastFromChangelog();
Expand Down Expand Up @@ -61,7 +58,7 @@ const tasks = new Listr( [

( async () => {
try {
githubToken = await provideToken();
githubToken = await releaseTools.provideToken();

await tasks.run();
} catch ( err ) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,13 @@

/* eslint-env node */

'use strict';

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

/**
* @param {Array.<String>} cliArguments
* @returns {ReleaseOptions} options
*/
module.exports = function parseArguments( cliArguments ) {
export default function parseArguments( cliArguments ) {
const config = {
string: [
'npm-tag'
Expand All @@ -30,7 +28,7 @@ module.exports = function parseArguments( cliArguments ) {
delete options[ 'npm-tag' ];

return options;
};
}

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

0 comments on commit c156bee

Please sign in to comment.