From 177d2e35a1bd370024ce64e745d6a0c144dfc7dd Mon Sep 17 00:00:00 2001 From: Kamil Piechaczek Date: Tue, 5 May 2020 10:39:18 +0200 Subject: [PATCH] Removed unnecessary scripts after merging the main repository to the monorepo. --- .../bin/install-dependencies.sh | 44 --- .../bin/prepare-mrgit-json.js | 34 --- .../bin/prepare-package-json.js | 45 --- .../ckeditor5-dev-tests/bin/save-revision.js | 73 ----- .../ckeditor5-dev-tests/bin/test-travis.sh | 23 -- .../lib/bin/createmrgitjsoncontent.js | 70 ----- .../ckeditor5-dev-tests/lib/mrgit-resolver.js | 34 --- packages/ckeditor5-dev-tests/package.json | 6 - .../tests/bin/createmrgitjsoncontent.js | 256 ------------------ 9 files changed, 585 deletions(-) delete mode 100755 packages/ckeditor5-dev-tests/bin/install-dependencies.sh delete mode 100755 packages/ckeditor5-dev-tests/bin/prepare-mrgit-json.js delete mode 100755 packages/ckeditor5-dev-tests/bin/prepare-package-json.js delete mode 100755 packages/ckeditor5-dev-tests/bin/save-revision.js delete mode 100755 packages/ckeditor5-dev-tests/bin/test-travis.sh delete mode 100644 packages/ckeditor5-dev-tests/lib/bin/createmrgitjsoncontent.js delete mode 100644 packages/ckeditor5-dev-tests/lib/mrgit-resolver.js delete mode 100644 packages/ckeditor5-dev-tests/tests/bin/createmrgitjsoncontent.js diff --git a/packages/ckeditor5-dev-tests/bin/install-dependencies.sh b/packages/ckeditor5-dev-tests/bin/install-dependencies.sh deleted file mode 100755 index 0f317f8cc..000000000 --- a/packages/ckeditor5-dev-tests/bin/install-dependencies.sh +++ /dev/null @@ -1,44 +0,0 @@ -#!/usr/bin/env bash - -set -e - -# Current work directory. -PACKAGE_ROOT=$(pwd) - -# Path to the executable in CWD. -ROOT_BIN=${PACKAGE_ROOT}/node_modules/.bin - -# Path to the testing environment. -TEST_DIR=$(mktemp -d) - -# Path to the executable in the testing environment. -TEST_BIN=${TEST_DIR}/node_modules/.bin - -# Creates required files for mrgit and yarn. -echo '{}' > ${TEST_DIR}/package.json -echo '{}' > ${TEST_DIR}/mrgit.json -mkdir ${TEST_DIR}/packages - -# Prepare `package.json`. It creates a "temporary" package. -${ROOT_BIN}/ckeditor5-dev-tests-prepare-package-json ${PACKAGE_ROOT} ${TEST_DIR} - -# Prepare `mrgit.json`. -${ROOT_BIN}/ckeditor5-dev-tests-prepare-mrgit-json ${TEST_DIR} - -# Install mrgit. -cd ${TEST_DIR} && yarn add mrgit --ignore-workspace-root-check - -# Clones repositories to `packages/` directory. -cd ${TEST_DIR} && ${TEST_BIN}/mrgit sync --recursive --resolver-path=${PACKAGE_ROOT}/node_modules/@ckeditor/ckeditor5-dev-tests/lib/mrgit-resolver.js - -# We need to ignore the newly created packages dir with all its content (see #203). -cd ${TEST_DIR} && echo -e "\npackages/**\n" >> .gitignore - -# Dependencies for CKEditor5-like project. -cd ${TEST_DIR} && yarn install - -# Be sure that the testing environment path can be available for other scripts... -echo ${TEST_DIR} > ${PACKAGE_ROOT}/.ckeditor5_test_environment - -# ...and CWD is set to the proper directory. -cd ${PACKAGE_ROOT} diff --git a/packages/ckeditor5-dev-tests/bin/prepare-mrgit-json.js b/packages/ckeditor5-dev-tests/bin/prepare-mrgit-json.js deleted file mode 100755 index 87e6b8637..000000000 --- a/packages/ckeditor5-dev-tests/bin/prepare-mrgit-json.js +++ /dev/null @@ -1,34 +0,0 @@ -#!/usr/bin/env node - -/** - * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved. - * For licensing, see LICENSE.md. - */ - -'use strict'; - -const TEST_DIR_PATH = process.argv[ 2 ]; - -if ( !TEST_DIR_PATH ) { - throw new Error( 'The script requires one parameter: a path to the testing directory.' ); -} - -const path = require( 'path' ); -const createMrGitJsonContent = require( '../lib/bin/createmrgitjsoncontent' ); -const { tools } = require( '@ckeditor/ckeditor5-dev-utils' ); - -tools.updateJSONFile( path.join( TEST_DIR_PATH, 'mrgit.json' ), () => { - const originalPackageJson = require( path.join( process.cwd(), 'package.json' ) ); - const testingPackageJson = require( path.join( TEST_DIR_PATH, 'package.json' ) ); - - return createMrGitJsonContent( testingPackageJson, { - packageName: originalPackageJson.name, - // For PR build we want to get the latest commit from given PR instead of Merge Commit. - // See: https://github.com/ckeditor/ckeditor5-dev/issues/484 - commit: process.env.TRAVIS_PULL_REQUEST_SHA || process.env.TRAVIS_COMMIT, - // Specify a repository that provides the package specified as `packageName` and which should be cloned. - // Forked repositories should be able to execute the test scenario as well. - // See: https://github.com/ckeditor/ckeditor5-dev/issues/542. - repository: process.env.TRAVIS_PULL_REQUEST_SLUG || process.env.TRAVIS_REPO_SLUG - } ); -} ); diff --git a/packages/ckeditor5-dev-tests/bin/prepare-package-json.js b/packages/ckeditor5-dev-tests/bin/prepare-package-json.js deleted file mode 100755 index 566700d1c..000000000 --- a/packages/ckeditor5-dev-tests/bin/prepare-package-json.js +++ /dev/null @@ -1,45 +0,0 @@ -#!/usr/bin/env node - -/** - * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved. - * For licensing, see LICENSE.md. - */ - -'use strict'; - -const PACKAGE_PATH = process.argv[ 2 ]; -const TEST_DIR_PATH = process.argv[ 3 ]; - -if ( !PACKAGE_PATH || !TEST_DIR_PATH ) { - throw new Error( 'The script requires two parameters: a path to the package and a path to the testing directory.' ); -} - -const path = require( 'path' ); -const { tools } = require( '@ckeditor/ckeditor5-dev-utils' ); -const packageJson = require( path.join( PACKAGE_PATH, 'package.json' ) ); - -tools.updateJSONFile( path.join( TEST_DIR_PATH, 'package.json' ), () => { - const json = { - name: 'ckeditor5-dev-testing-environment', - version: '0.0.1', - description: 'This package is a temporary package used for preparing the testing environment. It is used only for CI.', - dependencies: packageJson.dependencies, - devDependencies: packageJson.devDependencies, - engines: packageJson.engines, - author: packageJson.author, - license: packageJson.license, - homepage: packageJson.homepage, - repository: packageJson.repository, - scripts: packageJson.scripts, - eslintIgnore: packageJson.eslintIgnore, - private: true, - workspaces: [ - 'packages/*' - ] - }; - - // Add the current testing package as a dependency for the testing-environment. - json.dependencies[ packageJson.name ] = '^' + packageJson.version; - - return json; -} ); diff --git a/packages/ckeditor5-dev-tests/bin/save-revision.js b/packages/ckeditor5-dev-tests/bin/save-revision.js deleted file mode 100755 index c6c9c8385..000000000 --- a/packages/ckeditor5-dev-tests/bin/save-revision.js +++ /dev/null @@ -1,73 +0,0 @@ -#!/usr/bin/env node - -/** - * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved. - * For licensing, see LICENSE.md. - */ - -'use strict'; - -const branch = process.env.TRAVIS_BRANCH; -const buildType = process.env.TRAVIS_EVENT_TYPE; - -// Save revision only when commit has made directly on the "master" branch. -if ( branch !== 'master' || buildType !== 'push' ) { - process.exit(); -} - -const path = require( 'path' ); -const { tools } = require( '@ckeditor/ckeditor5-dev-utils' ); - -const mainRepoUrl = 'https://github.com/ckeditor/ckeditor5'; -const revisionBranch = `${ branch }-revisions`; - -// Clone the repository. -exec( `git clone ${ mainRepoUrl }.git` ); - -// Change current dir to cloned repository. -process.chdir( path.join( process.cwd(), 'ckeditor5' ) ); - -// And check out to the revision branch. -exec( `git checkout ${ revisionBranch } ` ); - -// Install Mr. Git. -exec( 'npm install -g mrgit' ); - -// Sync the revision branch with the master. -exec( `git checkout ${ branch } -- .` ); - -// Remove all files from "staged". -exec( 'git reset -q .' ); - -// Install dependencies. -exec( 'mrgit sync --recursive --resolver-url-template="https://github.com/\\${ path }.git"' ); - -// Save hashes from all dependencies. -exec( 'mrgit save --hash' ); - -// Add all files (perhaps the changes from master will be committed). -exec( 'git add .' ); - -const repository = process.env.TRAVIS_REPO_SLUG; -const commit = process.env.TRAVIS_COMMIT; -const commitMessage = `Revision: https://github.com/${ repository }/commit/${ commit }`; - -// Check whether any of the files have changed. It might happen that none has changed if a build was restarted -// or two builds were running at the same time. -if ( exec( 'git status -s' ).trim().length ) { - exec( `git commit -m "${ commitMessage }"` ); - - exec( `echo "https://${ process.env.GITHUB_TOKEN }:@github.com" > .git/credentials 2> /dev/null` ); - exec( 'git config credential.helper "store --file=.git/credentials"' ); - - exec( `git push origin ${ revisionBranch } --quiet` ); - - const lastCommit = exec( 'git log -1 --format="%h"' ); - console.log( `Successfully saved the revision under ${ mainRepoUrl }/commit/${ lastCommit }` ); -} else { - console.log( 'Nothing to commit. The revision log is up to date.' ); -} - -function exec( command ) { - return tools.shExec( command, { verbosity: 'error' } ); -} diff --git a/packages/ckeditor5-dev-tests/bin/test-travis.sh b/packages/ckeditor5-dev-tests/bin/test-travis.sh deleted file mode 100755 index 62e3f3e33..000000000 --- a/packages/ckeditor5-dev-tests/bin/test-travis.sh +++ /dev/null @@ -1,23 +0,0 @@ -#!/usr/bin/env bash - -# Breaks the entire script if any command returned exit code other than 0. -set -e - -# Current work directory. -PACKAGE_ROOT=$(pwd) - -# Path to the exeutable in CWD. -ROOT_BIN=${PACKAGE_ROOT}/node_modules/.bin - -PACKAGE_NAME=$(node -e "console.log( require( process.cwd() + '/package.json' ).name.replace( /@ckeditor\/ckeditor5?-/, '' ) )"); - -# The `.ckeditor5_test_environment` file is created by the "install-dependencies" script. -CKEDITOR5_TEST_ENVIRONMENT=$(cat ${PACKAGE_ROOT}/.ckeditor5_test_environment) - -# Linter and dependency checker tasks must be executed from the original package. -yarn run lint && \ -yarn run stylelint && \ -${ROOT_BIN}/ckeditor5-dev-tests-check-dependencies && \ -cd ${CKEDITOR5_TEST_ENVIRONMENT} && \ -node --max_old_space_size=4096 $ROOT_BIN/ckeditor5-dev-tests --files=$PACKAGE_NAME --coverage --reporter=dots --browsers=Chrome --production && \ -node --max_old_space_size=4096 $ROOT_BIN/ckeditor5-dev-tests --files=$PACKAGE_NAME --reporter=dots --browsers=Firefox --production diff --git a/packages/ckeditor5-dev-tests/lib/bin/createmrgitjsoncontent.js b/packages/ckeditor5-dev-tests/lib/bin/createmrgitjsoncontent.js deleted file mode 100644 index 698c2accf..000000000 --- a/packages/ckeditor5-dev-tests/lib/bin/createmrgitjsoncontent.js +++ /dev/null @@ -1,70 +0,0 @@ -/** - * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved. - * For licensing, see LICENSE.md. - */ - -/** - * Creates content for the `mrgit.json` file based on the `package.json` dependencies. - * - * @param {Object} packageJson Parsed package.json. - * @param {Object} [options] - * @param {String} options.name The name of the package that `options.commit` or `options.repository` will be modified. - * @param {String} options.commit The specified commit. - * @param {String} options.repository The specified repository. - */ -module.exports = function createMrGitJsonContent( packageJson, options ) { - const mrgitJson = { - packages: 'packages/', - dependencies: {} - }; - - const dependencies = Object.assign( {}, packageJson.dependencies, packageJson.devDependencies ); - - for ( const dependencyName in dependencies ) { - const dependencyVersion = dependencies[ dependencyName ]; - - if ( - !dependencyName.match( /^@ckeditor\/ckeditor5?/ ) && - !dependencyVersion.includes( 'cksource/ckeditor' ) - ) { - continue; - } - - if ( dependencyName.includes( '/ckeditor5-dev' ) ) { - continue; - } - - if ( isHashedDependency( dependencyVersion ) ) { - mrgitJson.dependencies[ dependencyName ] = dependencyVersion; - } else { - // Removes '@' from the scoped npm package name. - mrgitJson.dependencies[ dependencyName ] = dependencyName.slice( 1 ); - } - } - - if ( !options ) { - return mrgitJson; - } - - // Do not modify value of the repository if specified package belongs to our ecosystem. - if ( options.repository === mrgitJson.dependencies[ options.packageName ] ) { - delete options.repository; - } - - // If `options.repository` is defined, use that value as a repository that should be cloned. - const repository = options.repository ? options.repository : mrgitJson.dependencies[ options.packageName ]; - - // If `options.commit` is defined, use that value as a commit which cloned repository should be checked out. - const commit = options.commit ? '#' + options.commit : ''; - - // If the package is defined, let's modify those values. - if ( mrgitJson.dependencies[ options.packageName ] ) { - mrgitJson.dependencies[ options.packageName ] = repository + commit; - } - - return mrgitJson; -}; - -function isHashedDependency( dependency ) { - return dependency.match( /#[0-9a-f]+$/ ); -} diff --git a/packages/ckeditor5-dev-tests/lib/mrgit-resolver.js b/packages/ckeditor5-dev-tests/lib/mrgit-resolver.js deleted file mode 100644 index eb538fdf0..000000000 --- a/packages/ckeditor5-dev-tests/lib/mrgit-resolver.js +++ /dev/null @@ -1,34 +0,0 @@ -/** - * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved. - * For licensing, see LICENSE.md. - */ - -'use strict'; - -const parseRepositoryUrl = require( 'mrgit/lib/utils/parserepositoryurl' ); - -/** - * Resolves repository URL for a given package name. - * - * @param {String} packageName Package name. - * @param {Options} data.options The options object. - * @returns {Repository|null} - */ -module.exports = function resolver( packageName, options ) { - let repositoryUrl = options.dependencies[ packageName ]; - - if ( !repositoryUrl ) { - if ( packageName.match( /^@ckeditor\/ckeditor5?-(?!dev)/ ) ) { - repositoryUrl = packageName.slice( 1 ); - } else { - return null; - } - } - - const repository = parseRepositoryUrl( repositoryUrl, { - urlTemplate: 'https://github.com/${ path }.git', - defaultBranch: options.resolverDefaultBranch - } ); - - return repository; -}; diff --git a/packages/ckeditor5-dev-tests/package.json b/packages/ckeditor5-dev-tests/package.json index 089366892..20e403ddb 100644 --- a/packages/ckeditor5-dev-tests/package.json +++ b/packages/ckeditor5-dev-tests/package.json @@ -39,7 +39,6 @@ "minimist": "^1.2.0", "mkdirp": "^0.5.1", "mocha": "^6.1.4", - "mrgit": "^1.0.0", "postcss-loader": "^3.0.0", "raw-loader": "^3.1.0", "sinon": "^7.3.2", @@ -62,11 +61,6 @@ "bin": { "ckeditor5-dev-tests": "./bin/test.js", "ckeditor5-dev-tests-manual": "./bin/test-manual.js", - "ckeditor5-dev-tests-travis": "./bin/test-travis.sh", - "ckeditor5-dev-tests-prepare-mrgit-json": "./bin/prepare-mrgit-json.js", - "ckeditor5-dev-tests-prepare-package-json": "./bin/prepare-package-json.js", - "ckeditor5-dev-tests-install-dependencies": "./bin/install-dependencies.sh", - "ckeditor5-dev-tests-save-revision": "./bin/save-revision.js", "ckeditor5-dev-tests-check-dependencies": "./bin/check-dependencies.js", "ckeditor5-dev-tests-notify-travis-status": "./bin/notify-travis-status.js" }, diff --git a/packages/ckeditor5-dev-tests/tests/bin/createmrgitjsoncontent.js b/packages/ckeditor5-dev-tests/tests/bin/createmrgitjsoncontent.js deleted file mode 100644 index 10ebf4c9b..000000000 --- a/packages/ckeditor5-dev-tests/tests/bin/createmrgitjsoncontent.js +++ /dev/null @@ -1,256 +0,0 @@ -/** - * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved. - * For licensing, see LICENSE.md. - */ - -'use strict'; - -const { expect } = require( 'chai' ); - -describe( 'dev-tests/bin/create-mrgit-json', () => { - let createMrGitJsonContent; - - beforeEach( () => { - createMrGitJsonContent = require( '../../lib/bin/createmrgitjsoncontent' ); - } ); - - it( 'should return a valid mrgit config when no dependency in package.json present', () => { - const mrgitJson = createMrGitJsonContent( {} ); - - expect( mrgitJson ).to.deep.equal( { dependencies: {}, packages: 'packages/' } ); - } ); - - it( 'should return an object with dependency names for npm versions of dependencies', () => { - const mrgitJson = createMrGitJsonContent( { - dependencies: { - '@ckeditor/ckeditor5-core': '^0.8.1', - '@ckeditor/ckeditor5-engine': '0.10.0' - }, - devDependencies: { - '@ckeditor/ckeditor5-basic-styles': '^0.8.1' - } - } ); - - expect( mrgitJson ).to.deep.equal( { - dependencies: { - '@ckeditor/ckeditor5-core': 'ckeditor/ckeditor5-core', - '@ckeditor/ckeditor5-engine': 'ckeditor/ckeditor5-engine', - '@ckeditor/ckeditor5-basic-styles': 'ckeditor/ckeditor5-basic-styles' - }, - packages: 'packages/' - } ); - } ); - - it( 'should work with "ckeditor-" prefix', () => { - const mrgitJson = createMrGitJsonContent( { - dependencies: { - '@ckeditor/ckeditor-core': '^0.8.1', - '@ckeditor/ckeditor-engine': '0.10.0' - }, - devDependencies: { - '@ckeditor/ckeditor5-basic-styles': '^0.8.1' - } - } ); - - expect( mrgitJson ).to.deep.equal( { - dependencies: { - '@ckeditor/ckeditor-core': 'ckeditor/ckeditor-core', - '@ckeditor/ckeditor-engine': 'ckeditor/ckeditor-engine', - '@ckeditor/ckeditor5-basic-styles': 'ckeditor/ckeditor5-basic-styles' - }, - packages: 'packages/' - } ); - } ); - - it( 'should return an object with hashed dependency versions for hashed github versions of dependencies', () => { - const mrgitJson = createMrGitJsonContent( { - dependencies: { - '@ckeditor/ckeditor5-core': 'ckeditor/ckeditor5-core#1ca5608', - 'ckeditor5-some-package': 'git@github.com:cksource/ckeditor5-some-package.git#1234567', - 'ckeditor-some-package': 'git@github.com:cksource/ckeditor-some-package.git#abcdef0' - }, - devDependencies: { - '@ckeditor/ckeditor5-paragraph': 'ckeditor/ckeditor5-paragraph#a171de3' - } - } ); - - expect( mrgitJson ).to.deep.equal( { - dependencies: { - '@ckeditor/ckeditor5-core': 'ckeditor/ckeditor5-core#1ca5608', - '@ckeditor/ckeditor5-paragraph': 'ckeditor/ckeditor5-paragraph#a171de3', - 'ckeditor5-some-package': 'git@github.com:cksource/ckeditor5-some-package.git#1234567', - 'ckeditor-some-package': 'git@github.com:cksource/ckeditor-some-package.git#abcdef0' - }, - packages: 'packages/' - } ); - } ); - - it( 'should filter out all non "ckeditor5-*" and all "ckeditor5-dev-*" packages', () => { - const mrgitJson = createMrGitJsonContent( { - dependencies: { - '@scope/package1': 'abc/def#1ca5608', - '@scope/package2': '^1.1.1', - 'package3': '^2.2.2' - }, - devDependencies: { - '@ckeditor/ckeditor5-dev-docs': '^11.0.0' - } - } ); - - expect( mrgitJson ).to.deep.equal( { - dependencies: {}, - packages: 'packages/' - } ); - } ); - - it( 'modifies version of specified package (it sets proper commit)', () => { - const mrgitJson = createMrGitJsonContent( { - dependencies: { - '@ckeditor/ckeditor5-core': '^0.8.1', - '@ckeditor/ckeditor5-engine': '0.10.0' - }, - devDependencies: { - '@ckeditor/ckeditor5-basic-styles': '^0.8.1' - } - }, { - packageName: '@ckeditor/ckeditor5-core', - commit: 'abcd1234' - } ); - - expect( mrgitJson ).to.deep.equal( { - dependencies: { - '@ckeditor/ckeditor5-core': 'ckeditor/ckeditor5-core#abcd1234', - '@ckeditor/ckeditor5-engine': 'ckeditor/ckeditor5-engine', - '@ckeditor/ckeditor5-basic-styles': 'ckeditor/ckeditor5-basic-styles' - }, - packages: 'packages/' - } ); - } ); - - it( 'does not modify anything because required "packageName" is not specified', () => { - const mrgitJson = createMrGitJsonContent( { - dependencies: { - '@ckeditor/ckeditor5-core': '^0.8.1', - '@ckeditor/ckeditor5-engine': '0.10.0' - }, - devDependencies: { - '@ckeditor/ckeditor5-basic-styles': '^0.8.1' - } - }, { - packageName: '@ckeditor/ckeditor5-utils', - commit: 'abcd1234' - } ); - - expect( mrgitJson ).to.deep.equal( { - dependencies: { - '@ckeditor/ckeditor5-core': 'ckeditor/ckeditor5-core', - '@ckeditor/ckeditor5-engine': 'ckeditor/ckeditor5-engine', - '@ckeditor/ckeditor5-basic-styles': 'ckeditor/ckeditor5-basic-styles' - }, - packages: 'packages/' - } ); - } ); - - describe( 'forked repository', () => { - it( 'allows using forked repository (without specifying a commit)', () => { - const mrgitJson = createMrGitJsonContent( { - dependencies: { - '@ckeditor/ckeditor5-core': '^0.8.1', - '@ckeditor/ckeditor5-engine': '0.10.0' - }, - devDependencies: { - '@ckeditor/ckeditor5-basic-styles': '^0.8.1' - } - }, { - packageName: '@ckeditor/ckeditor5-core', - repository: 'foo/bar' - } ); - - expect( mrgitJson ).to.deep.equal( { - dependencies: { - '@ckeditor/ckeditor5-core': 'foo/bar', - '@ckeditor/ckeditor5-engine': 'ckeditor/ckeditor5-engine', - '@ckeditor/ckeditor5-basic-styles': 'ckeditor/ckeditor5-basic-styles' - }, - packages: 'packages/' - } ); - } ); - - it( 'allows using forked repository (with setting a proper commit)', () => { - const mrgitJson = createMrGitJsonContent( { - dependencies: { - '@ckeditor/ckeditor5-core': '^0.8.1', - '@ckeditor/ckeditor5-engine': '0.10.0' - }, - devDependencies: { - '@ckeditor/ckeditor5-basic-styles': '^0.8.1' - } - }, { - packageName: '@ckeditor/ckeditor5-core', - repository: 'foo/bar', - commit: 'abcd1234' - } ); - - expect( mrgitJson ).to.deep.equal( { - dependencies: { - '@ckeditor/ckeditor5-core': 'foo/bar#abcd1234', - '@ckeditor/ckeditor5-engine': 'ckeditor/ckeditor5-engine', - '@ckeditor/ckeditor5-basic-styles': 'ckeditor/ckeditor5-basic-styles' - }, - packages: 'packages/' - } ); - } ); - - it( 'does not modify anything because required "packageName" is not specified', () => { - const mrgitJson = createMrGitJsonContent( { - dependencies: { - '@ckeditor/ckeditor5-core': '^0.8.1', - '@ckeditor/ckeditor5-engine': '0.10.0' - }, - devDependencies: { - '@ckeditor/ckeditor5-basic-styles': '^0.8.1' - } - }, { - packageName: '@ckeditor/ckeditor5-utils', - repository: 'foo/bar' - } ); - - expect( mrgitJson ).to.deep.equal( { - dependencies: { - '@ckeditor/ckeditor5-core': 'ckeditor/ckeditor5-core', - '@ckeditor/ckeditor5-engine': 'ckeditor/ckeditor5-engine', - '@ckeditor/ckeditor5-basic-styles': 'ckeditor/ckeditor5-basic-styles' - }, - packages: 'packages/' - } ); - } ); - - it( 'removes `options.repository` value if the repository belongs to our ecosystem', () => { - const options = { - packageName: '@ckeditor/ckeditor5-core', - repository: 'ckeditor/ckeditor5-core' - }; - - const mrgitJson = createMrGitJsonContent( { - dependencies: { - '@ckeditor/ckeditor5-core': '^0.8.1', - '@ckeditor/ckeditor5-engine': '0.10.0' - }, - devDependencies: { - '@ckeditor/ckeditor5-basic-styles': '^0.8.1' - } - }, options ); - - expect( mrgitJson ).to.deep.equal( { - dependencies: { - '@ckeditor/ckeditor5-core': 'ckeditor/ckeditor5-core', - '@ckeditor/ckeditor5-engine': 'ckeditor/ckeditor5-engine', - '@ckeditor/ckeditor5-basic-styles': 'ckeditor/ckeditor5-basic-styles' - }, - packages: 'packages/' - } ); - - expect( options.repository ).to.be.undefined; - } ); - } ); -} );