Skip to content

Commit

Permalink
Merge pull request #994 from ckeditor/ci/3746-unused-utils
Browse files Browse the repository at this point in the history
Other: Added several missing `dependencies` and `devDependencies` in packages. Also, removed non-used ones.

Other (dependency-checker): The dependency checker analyzes dependencies by including the `lib/` and `bin/` directories as production code.

Internal: Created a test script that executed tests from all packages one by one instead of merging each test into a single process.

Internal: Improved the CI machines to speed up the builds.

Other (utils): Removed several utilities functions non-used in the CKEditor 5 environment.

MAJOR BREAKING CHANGE (utils): The `git` and `workspace` objects are no longer exported from the package. Also, the following functions are no longer available in the `tools` object:

* `isDirectory()`
* `isFile()`
* `isSymlink()`
* `sortObject()`
* `readPackageName()`
* `npmInstall()`
* `npmUninstall()`
* `npmUpdate()`
* `copyTemplateFile()`
* `copyFile()`
* `getGitUrlFromNpm()`
* `removeSymlink()`
* `clean()`
  • Loading branch information
pomek authored Aug 30, 2024
2 parents 848ff18 + d102ba4 commit e84c701
Show file tree
Hide file tree
Showing 44 changed files with 637 additions and 1,783 deletions.
14 changes: 9 additions & 5 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ commands:
CKE5_GITHUB_REPOSITORY="ckeditor5-dev"
CKE5_CIRCLE_APPROVAL_JOB_NAME="release_approval"
CKE5_GITHUB_RELEASE_BRANCH="master"
echo export CKE5_CIRCLE_APPROVAL_JOB_NAME=$CKE5_CIRCLE_APPROVAL_JOB_NAME >> $BASH_ENV
echo export CKE5_GITHUB_RELEASE_BRANCH=$CKE5_GITHUB_RELEASE_BRANCH >> $BASH_ENV
echo export CKE5_GITHUB_ORGANIZATION=$CKE5_GITHUB_ORGANIZATION >> $BASH_ENV
Expand Down Expand Up @@ -96,6 +96,7 @@ jobs:

validate_and_tests:
machine: true
resource_class: large
steps:
- checkout
- bootstrap_repository_command
Expand Down Expand Up @@ -126,6 +127,7 @@ jobs:

release_prepare:
machine: true
resource_class: large
steps:
- checkout
- bootstrap_repository_command
Expand All @@ -135,6 +137,7 @@ jobs:

trigger_release_process:
machine: true
resource_class: large
steps:
- checkout
- bootstrap_repository_command
Expand All @@ -159,17 +162,18 @@ jobs:

release_project:
machine: true
resource_class: large
steps:
- checkout
- bootstrap_repository_command
- run:
name: Verify the trigger commit from the repository
command: |
#!/bin/bash
CKE5_LATEST_COMMIT_HASH=$( git log -n 1 --pretty=format:%H origin/master )
CKE5_TRIGGER_COMMIT_HASH=<< pipeline.parameters.triggerCommitHash >>
if [[ "${CKE5_LATEST_COMMIT_HASH}" != "${CKE5_TRIGGER_COMMIT_HASH}" ]]; then
echo "There is a newer commit in the repository on the \`#master\` branch. Use its build to start the release."
circleci-agent step halt
Expand All @@ -180,13 +184,13 @@ jobs:
name: Verify if a releaser triggered the job
command: |
#!/bin/bash
# Do not fail if the Node script ends with non-zero exit code.
set +e
yarn ckeditor5-dev-ci-is-job-triggered-by-member
EXIT_CODE=$( echo $? )
if [ ${EXIT_CODE} -ne 0 ];
then
echo "Aborting the release due to failed verification of the approver (no rights to release)."
Expand Down
4 changes: 2 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@

.idea
**/node_modules/**
.nyc_output/**
coverage/**
.nyc_output/
coverage/
npm-debug.log
yarn.lock
executeinparallel-integration.log
Expand Down
35 changes: 18 additions & 17 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,37 +2,38 @@
"name": "ckeditor5-dev",
"version": "42.1.0",
"private": true,
"author": "CKSource (http://cksource.com/)",
"license": "GPL-2.0-or-later",
"bugs": "https://github.com/ckeditor/ckeditor5/issues",
"repository": {
"type": "git",
"url": "https://github.com/ckeditor/ckeditor5-dev.git"
},
"homepage": "https://github.com/ckeditor/ckeditor5-dev#readme",
"engines": {
"node": ">=18.0.0"
},
"devDependencies": {
"@ckeditor/ckeditor5-dev-ci": "^42.1.0",
"@ckeditor/ckeditor5-dev-release-tools": "^42.1.0",
"@ckeditor/ckeditor5-dev-bump-year": "^42.1.0",
"coveralls": "^3.1.1",
"eslint": "^7.0.0",
"eslint-config-ckeditor5": "^6.0.0",
"fs-extra": "^11.2.0",
"glob": "^10.2.5",
"husky": "^8.0.2",
"lint-staged": "^10.2.4",
"listr2": "^6.5.0",
"mocha": "^7.1.2",
"minimist": "^1.2.8",
"nyc": "^15.1.0",
"semver": "^7.5.3"
"semver": "^7.5.3",
"upath": "^2.0.1"
},
"engines": {
"node": ">=18.0.0"
},
"author": "CKSource (http://cksource.com/)",
"license": "GPL-2.0-or-later",
"bugs": "https://github.com/ckeditor/ckeditor5-dev/issues",
"repository": {
"type": "git",
"url": "https://github.com/ckeditor/ckeditor5-dev.git"
},
"homepage": "https://github.com/ckeditor/ckeditor5-dev#readme",
"scripts": {
"postinstall": "node ./scripts/postinstall.js",
"test": "yarn run test:build-tools && yarn run test:js",
"test:build-tools": "yarn workspace @ckeditor/ckeditor5-dev-build-tools run test",
"test:js": "mocha 'packages/*/tests/**/*.js' --timeout 10000 --ignore 'packages/ckeditor5-dev-build-tools/**'",
"coverage": "nyc --reporter=lcov --reporter=text-summary yarn run test",
"test": "node ./scripts/runtest.js",
"coverage": "node ./scripts/runtest.js --coverage",
"changelog": "node ./scripts/changelog.js",
"release:prepare-packages": "node ./scripts/preparepackages.js",
"release:publish-packages": "node ./scripts/publishpackages.js",
Expand Down
12 changes: 10 additions & 2 deletions packages/ckeditor5-dev-build-tools/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@
"ckeditor5-dev-build-tools": "bin/build-project.js"
},
"dependencies": {
"@fullhuman/postcss-purgecss": "^6.0.0",
"@rollup/plugin-commonjs": "^25.0.7",
"@rollup/plugin-json": "^6.1.0",
"@rollup/plugin-node-resolve": "^15.2.3",
Expand All @@ -44,8 +43,10 @@
"lodash-es": "^4.17.21",
"magic-string": "^0.30.6",
"pofile": "^1.1.4",
"postcss": "^8.0.0",
"postcss-mixins": "^9.0.4",
"postcss-nesting": "^12.0.2",
"purgecss": "^6.0.0",
"rollup": "^4.9.5",
"rollup-plugin-styles": "^4.0.0",
"rollup-plugin-svg-import": "^3.0.0",
Expand All @@ -66,6 +67,13 @@
"build": "rollup -c rollup.config.js",
"dev": "rollup -c rollup.config.js --watch",
"test": "vitest run --config vitest.config.ts",
"coverage": "vitest run --config vitest.config.ts --coverage",
"test:dev": "vitest dev"
}
},
"depcheckIgnore": [
"@types/css",
"@vitest/coverage-v8",
"estree",
"typescript"
]
}
4 changes: 2 additions & 2 deletions packages/ckeditor5-dev-build-tools/vitest.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@ export default defineConfig( {
testTimeout: 10000,
restoreMocks: true,
coverage: {
enabled: true,
provider: 'v8',
include: [
'src/**'
]
],
reporter: [ 'text', 'json', 'html', 'lcov' ]
}
}
} );
24 changes: 12 additions & 12 deletions packages/ckeditor5-dev-bump-year/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,6 @@
"version": "42.1.0",
"description": "Used to bump year in the licence text specified at the top of the file.",
"keywords": [],
"main": "lib/index.js",
"dependencies": {
"chalk": "^4.1.0",
"glob": "^10.2.5"
},
"engines": {
"node": ">=18.0.0",
"npm": ">=5.7.1"
},
"files": [
"lib"
],
"author": "CKSource (http://cksource.com/)",
"license": "GPL-2.0-or-later",
"homepage": "https://github.com/ckeditor/ckeditor5-dev/tree/master/packages/ckeditor5-dev-bump-year",
Expand All @@ -23,5 +11,17 @@
"type": "git",
"url": "https://github.com/ckeditor/ckeditor5-dev.git",
"directory": "packages/ckeditor5-dev-bump-year"
},
"engines": {
"node": ">=18.0.0",
"npm": ">=5.7.1"
},
"main": "lib/index.js",
"files": [
"lib"
],
"dependencies": {
"chalk": "^4.1.0",
"glob": "^10.2.5"
}
}
44 changes: 25 additions & 19 deletions packages/ckeditor5-dev-ci/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,22 +3,20 @@
"version": "42.1.0",
"description": "Utils used on various Continuous Integration services.",
"keywords": [],
"main": "lib/index.js",
"dependencies": {
"minimist": "^1.2.8",
"node-fetch": "^2.6.7",
"slack-notify": "^2.0.6"
},
"devDependencies": {
"chai": "^4.2.0",
"proxyquire": "^2.1.3",
"mockery": "^2.1.0",
"sinon": "^9.2.4"
"author": "CKSource (http://cksource.com/)",
"license": "GPL-2.0-or-later",
"homepage": "https://github.com/ckeditor/ckeditor5-dev/tree/master/packages/ckeditor5-dev-ci",
"bugs": "https://github.com/ckeditor/ckeditor5/issues",
"repository": {
"type": "git",
"url": "https://github.com/ckeditor/ckeditor5-dev.git",
"directory": "packages/ckeditor5-dev-ci"
},
"engines": {
"node": ">=18.0.0",
"npm": ">=5.7.1"
},
"main": "lib/index.js",
"files": [
"bin",
"lib"
Expand All @@ -34,13 +32,21 @@
"ckeditor5-dev-ci-circle-disable-auto-cancel-builds": "bin/circle-disable-auto-cancel-builds.js",
"ckeditor5-dev-ci-circle-enable-auto-cancel-builds": "bin/circle-enable-auto-cancel-builds.js"
},
"author": "CKSource (http://cksource.com/)",
"license": "GPL-2.0-or-later",
"homepage": "https://github.com/ckeditor/ckeditor5-dev/tree/master/packages/ckeditor5-dev-ci",
"bugs": "https://github.com/ckeditor/ckeditor5/issues",
"repository": {
"type": "git",
"url": "https://github.com/ckeditor/ckeditor5-dev.git",
"directory": "packages/ckeditor5-dev-ci"
"dependencies": {
"@octokit/rest": "^19.0.0",
"minimist": "^1.2.8",
"node-fetch": "^2.6.7",
"slack-notify": "^2.0.6"
},
"devDependencies": {
"chai": "^4.2.0",
"mocha": "^7.1.2",
"proxyquire": "^2.1.3",
"mockery": "^2.1.0",
"sinon": "^9.2.4"
},
"scripts": {
"test": "mocha './tests/**/*.js' --timeout 10000",
"coverage": "nyc --reporter=lcov --reporter=text-summary yarn run test"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
'use strict';

const fs = require( 'fs' );
const upath = require( 'path' );
const upath = require( 'upath' );
const { globSync } = require( 'glob' );
const depCheck = require( 'depcheck' );
const chalk = require( 'chalk' );
Expand Down Expand Up @@ -390,7 +390,9 @@ async function isDevDependency( packageName, absolutePaths ) {
/**
* These folders contain the source code of the packages.
*/
/[/\\]bin[/\\]/,
/[/\\]src[/\\]/,
/[/\\]lib[/\\]/,
/[/\\]theme[/\\]/,

/**
Expand Down
30 changes: 15 additions & 15 deletions packages/ckeditor5-dev-dependency-checker/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,14 @@
"version": "42.1.0",
"description": "Contains tools for validating dependencies specified in package.json.",
"keywords": [],
"dependencies": {
"@ckeditor/ckeditor5-dev-utils": "^42.1.0",
"chalk": "^4.1.0",
"depcheck": "^1.3.1",
"glob": "^10.2.5",
"minimist": "^1.2.8",
"upath": "^2.0.1"
"author": "CKSource (http://cksource.com/)",
"license": "GPL-2.0-or-later",
"homepage": "https://github.com/ckeditor/ckeditor5-dev/tree/master/packages/ckeditor5-dev-dependency-checker",
"bugs": "https://github.com/ckeditor/ckeditor5/issues",
"repository": {
"type": "git",
"url": "https://github.com/ckeditor/ckeditor5-dev.git",
"directory": "packages/ckeditor5-dev-dependency-checker"
},
"engines": {
"node": ">=18.0.0",
Expand All @@ -22,13 +23,12 @@
"bin": {
"ckeditor5-dev-dependency-checker": "bin/dependencychecker.js"
},
"author": "CKSource (http://cksource.com/)",
"license": "GPL-2.0-or-later",
"homepage": "https://github.com/ckeditor/ckeditor5-dev/tree/master/packages/ckeditor5-dev-dependency-checker",
"bugs": "https://github.com/ckeditor/ckeditor5/issues",
"repository": {
"type": "git",
"url": "https://github.com/ckeditor/ckeditor5-dev.git",
"directory": "packages/ckeditor5-dev-dependency-checker"
"dependencies": {
"@ckeditor/ckeditor5-dev-utils": "^42.1.0",
"chalk": "^4.1.0",
"depcheck": "^1.3.1",
"glob": "^10.2.5",
"minimist": "^1.2.8",
"upath": "^2.0.1"
}
}
Loading

0 comments on commit e84c701

Please sign in to comment.