Skip to content

Commit

Permalink
Merge pull request #443 from ckeditor/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 2, 2024
2 parents 1cd8016 + 959624a commit d40dae0
Show file tree
Hide file tree
Showing 11 changed files with 2,473 additions and 2,503 deletions.
2 changes: 1 addition & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,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
18 changes: 9 additions & 9 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@
"test:e2e": "cypress run",
"test:e2e:ci": "start-server-and-test 'yarn run start' http://localhost:4200/ 'yarn run test:e2e --quiet'",
"coverage": "ng test --watch=false --code-coverage",
"lint": "eslint \"*/**/*.+(js|ts)\"",
"changelog": "node ./scripts/changelog.js",
"lint": "eslint \"*/**/*.+(js|mjs|ts)\"",
"changelog": "node ./scripts/changelog.mjs",
"build-package": "ng-packagr -p src/ckeditor/ng-package.json",
"release:prepare-packages": "node scripts/preparepackages.js",
"release:publish-packages": "node scripts/publishpackages.js"
"release:prepare-packages": "node scripts/preparepackages.mjs",
"release:publish-packages": "node scripts/publishpackages.mjs"
},
"dependencies": {
"@angular/animations": "^16",
Expand All @@ -38,10 +38,10 @@
"@angular/cli": "^16",
"@angular/compiler-cli": "^16",
"@angular/language-service": "^16",
"@ckeditor/ckeditor5-dev-bump-year": "^40.2.0",
"@ckeditor/ckeditor5-dev-ci": "^40.2.0",
"@ckeditor/ckeditor5-dev-release-tools": "^40.2.0",
"@ckeditor/ckeditor5-dev-utils": "^40.2.0",
"@ckeditor/ckeditor5-dev-bump-year": "^44.0.0",
"@ckeditor/ckeditor5-dev-ci": "^44.0.0",
"@ckeditor/ckeditor5-dev-release-tools": "^44.0.0",
"@ckeditor/ckeditor5-dev-utils": "^44.0.0",
"@types/jasminewd2": "^2.0.10",
"@types/node": "^14.11.8",
"@typescript-eslint/eslint-plugin": "~5.43.0",
Expand Down Expand Up @@ -94,7 +94,7 @@
"url": "https://github.com/ckeditor/ckeditor5-angular.git"
},
"lint-staged": {
"**/*.+(js|ts)": [
"**/*.+(js|mjs|ts)": [
"eslint --quiet"
]
},
Expand Down
46 changes: 0 additions & 46 deletions scripts/bump-year.js

This file was deleted.

47 changes: 47 additions & 0 deletions scripts/bump-year.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
#!/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|dist)/**',
options: {
ignore: [
'**/build/**',
'src/**'
]
}
},
{
pattern: 'src/ckeditor/**'
}
]
} );
7 changes: 3 additions & 4 deletions scripts/changelog.js → scripts/changelog.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,13 @@
* For licensing, see LICENSE.md.
*/

'use strict';

/* eslint-env node */

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

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

require( '@ckeditor/ckeditor5-dev-release-tools' ).generateChangelogForSinglePackage( {
generateChangelogForSinglePackage( {
releaseBranch: cliArguments.branch
} );
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( '../../package.json' );

const changelogVersion = releaseTools.getLastFromChangelog();
Expand Down
24 changes: 13 additions & 11 deletions scripts/preparepackages.js → scripts/preparepackages.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,17 @@

/* eslint-env node */

'use strict';

const { Listr } = require( 'listr2' );
const releaseTools = require( '@ckeditor/ckeditor5-dev-release-tools' );
const { tools } = require( '@ckeditor/ckeditor5-dev-utils' );
const upath = require( 'upath' );
const fs = require( 'fs-extra' );
const parseArguments = require( './utils/parsearguments' );
const getListrOptions = require( './utils/getlistroptions' );
import fs from 'fs-extra';
import upath from 'upath';
import { Listr } from 'listr2';
import { fileURLToPath } from 'url';
import * as releaseTools from '@ckeditor/ckeditor5-dev-release-tools';
import * as devUtils from '@ckeditor/ckeditor5-dev-utils';
import parseArguments from './utils/parsearguments.mjs';
import getListrOptions from './utils/getlistroptions.mjs';

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

const latestVersion = releaseTools.getLastFromChangelog();
const versionChangelog = releaseTools.getChangesForVersion( latestVersion );
Expand Down Expand Up @@ -69,7 +71,7 @@ const tasks = new Listr( [
{
title: 'Generating the `dist` directory.',
task: () => {
return tools.shExec( 'yarn run build-package', { async: true, verbosity: 'silent' } );
return devUtils.tools.shExec( 'yarn run build-package', { async: true, verbosity: 'silent' } );
}
},
{
Expand All @@ -81,7 +83,7 @@ const tasks = new Listr( [
{
title: 'Updating the `#version` field in the `package.json` in the release directory',
task: () => {
return tools.updateJSONFile(
return devUtils.tools.updateJSONFile(
upath.join( RELEASE_ANGULAR_DIR, 'package.json' ),
packageJson => {
packageJson.version = latestVersion;
Expand Down
13 changes: 5 additions & 8 deletions scripts/publishpackages.js → scripts/publishpackages.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,10 @@

/* 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' );
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';

const cliArguments = parseArguments( process.argv.slice( 2 ) );
const latestVersion = releaseTools.getLastFromChangelog();
Expand Down Expand Up @@ -94,7 +91,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
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,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 = {
boolean: [
'verbose',
Expand Down Expand Up @@ -48,7 +46,7 @@ module.exports = function parseArguments( cliArguments ) {
}

return options;
};
}

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

0 comments on commit d40dae0

Please sign in to comment.