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

Aligned to ckeditor5-dev ESM changes #171

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft
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
16 changes: 8 additions & 8 deletions package.json
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am wondering if we could remove the resolutions key. Let's check it once the next major of ckeditor5-dev goes live.

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-alpha.0",
"@ckeditor/ckeditor5-dev-ci": "^44.0.0-alpha.0",
"@ckeditor/ckeditor5-dev-release-tools": "^44.0.0-alpha.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