Browse Source

Merge branch 'master' into ckeditor5-engine/t/455

Szymon Kupś 9 years ago
parent
commit
a34e652992
46 changed files with 353 additions and 212 deletions
  1. 92 62
      .jscsrc
  2. 10 11
      .jshintrc
  3. 20 14
      README.md
  4. 1 1
      bender.js
  5. 10 11
      dev/.jshintrc
  6. 1 1
      dev/tasks/dev/templates/gulpfile.js
  7. 92 0
      dev/tasks/exec/functions/remove-use-strict.js
  8. 30 0
      dev/tasks/exec/functions/sh.js
  9. 6 1
      dev/tasks/exec/tasks.js
  10. 29 6
      dev/tests/utils/ckeditor5-dirs.js
  11. 10 1
      dev/utils/ckeditor5-dirs.js
  12. 1 1
      gulpfile.js
  13. 0 1
      package.json
  14. 0 2
      src/command/attributecommand.js
  15. 0 2
      src/command/command.js
  16. 0 2
      src/editor/editor.js
  17. 0 2
      src/editor/standardeditor.js
  18. 0 2
      src/feature.js
  19. 0 2
      src/keystrokehandler.js
  20. 0 2
      src/load__amd.js
  21. 0 2
      src/load__cjs.js
  22. 0 2
      src/load__esnext.js
  23. 0 2
      src/plugin.js
  24. 0 2
      src/plugincollection.js
  25. 21 23
      tests/.jshintrc
  26. 0 2
      tests/_utils-tests/classictesteditor.js
  27. 0 2
      tests/_utils-tests/createsinonsandbox.js
  28. 0 2
      tests/_utils-tests/modeltesteditor.js
  29. 0 2
      tests/_utils-tests/module__amd.js
  30. 0 2
      tests/_utils-tests/module__cjs.js
  31. 0 2
      tests/_utils-tests/virtualtesteditor.js
  32. 0 2
      tests/_utils/classictesteditor.js
  33. 0 2
      tests/_utils/modeltesteditor.js
  34. 0 2
      tests/_utils/module__amd.js
  35. 0 2
      tests/_utils/module__cjs.js
  36. 0 2
      tests/_utils/utils.js
  37. 0 2
      tests/_utils/virtualtesteditor.js
  38. 30 17
      tests/command/attributecommand.js
  39. 0 2
      tests/command/command.js
  40. 0 2
      tests/editor/editor-base.js
  41. 0 2
      tests/editor/editor.js
  42. 0 2
      tests/editor/standardeditor.js
  43. 0 2
      tests/keystrokehandler.js
  44. 0 2
      tests/load.js
  45. 0 2
      tests/plugin.js
  46. 0 2
      tests/plugincollection.js

+ 92 - 62
.jscsrc

@@ -1,63 +1,93 @@
 {
-	"esnext": true,
-
-	"requireCurlyBraces": [
-		"if", "else", "for", "while", "do", "switch", "try", "catch"
-	],
-	"requireSpaceBeforeKeywords": true,
-	"requireSpaceAfterKeywords": [
-		"do", "for", "if", "else", "switch", "case", "try", "catch", "void", "while", "with", "return", "typeof"
-	],
-	"requireSpaceBeforeBlockStatements": true,
-	"requireParenthesesAroundIIFE": true,
-	"requireSpacesInConditionalExpression": {
-		"afterTest": true,
-		"beforeConsequent": true,
-		"afterConsequent": true,
-		"beforeAlternate": true
-	},
-	"requireSpacesInFunction": {
-		"beforeOpeningCurlyBrace": true
-	},
-	"disallowSpacesInFunction": {
-		"beforeOpeningRoundBrace": true
-	},
-	"disallowSpacesInCallExpression": true,
-	"disallowMultipleVarDecl": "exceptUndefined",
-	"requireBlocksOnNewline": true,
-	"disallowPaddingNewlinesInBlocks": true,
-	"requirePaddingNewlinesBeforeKeywords": [
-		"do", "for", "if", "switch", "case", "try", "while", "with", "return"
-	],
-	"requireSpacesInsideObjectBrackets": "all",
-	"requireSpacesInsideArrayBrackets": "all",
-	"requireSpacesInsideParentheses": "all",
-	"disallowSpaceAfterObjectKeys": true,
-	"requireSpaceBeforeObjectValues": true,
-	"requireCommaBeforeLineBreak": true,
-	"requireOperatorBeforeLineBreak": true,
-	"disallowSpaceAfterPrefixUnaryOperators": true,
-	"disallowSpaceBeforePostfixUnaryOperators": true,
-	"requireSpaceBeforeBinaryOperators": true,
-	"disallowImplicitTypeConversion": [
-		"numeric", "binary", "string"
-	],
-	"requireCamelCaseOrUpperCaseIdentifiers": true,
-	"requireSpaceAfterBinaryOperators": true,
-	"disallowKeywords": [
-		"with"
-	],
-	"disallowMultipleLineStrings": true,
-	"disallowMultipleLineBreaks": true,
-	"disallowMixedSpacesAndTabs": true,
-	"disallowTrailingWhitespace": true,
-	"maximumLineLength": 140,
-	"requireCapitalizedConstructors": true,
-	"requireDotNotation": true,
-	"disallowYodaConditions": true,
-	"disallowNewlineBeforeBlockStatements": true,
-	"validateLineBreaks": "LF",
-	"validateQuoteMarks": "'",
-	"validateIndentation": "\t",
-	"safeContextKeyword": [ "that" ]
-}
+  "esnext": true,
+  "requireCurlyBraces": [
+    "if",
+    "else",
+    "for",
+    "while",
+    "do",
+    "switch",
+    "try",
+    "catch"
+  ],
+  "requireSpaceBeforeKeywords": true,
+  "requireSpaceAfterKeywords": [
+    "do",
+    "for",
+    "if",
+    "else",
+    "switch",
+    "case",
+    "try",
+    "catch",
+    "void",
+    "while",
+    "with",
+    "return",
+    "typeof"
+  ],
+  "requireSpaceBeforeBlockStatements": true,
+  "requireParenthesesAroundIIFE": true,
+  "requireSpacesInConditionalExpression": {
+    "afterTest": true,
+    "beforeConsequent": true,
+    "afterConsequent": true,
+    "beforeAlternate": true
+  },
+  "requireSpacesInFunction": {
+    "beforeOpeningCurlyBrace": true
+  },
+  "disallowSpacesInFunction": {
+    "beforeOpeningRoundBrace": true
+  },
+  "disallowSpacesInCallExpression": true,
+  "disallowMultipleVarDecl": "exceptUndefined",
+  "requireBlocksOnNewline": true,
+  "disallowPaddingNewlinesInBlocks": true,
+  "requirePaddingNewlinesBeforeKeywords": [
+    "do",
+    "for",
+    "if",
+    "switch",
+    "case",
+    "try",
+    "while",
+    "with",
+    "return"
+  ],
+  "requireSpacesInsideObjectBrackets": "all",
+  "requireSpacesInsideArrayBrackets": "all",
+  "requireSpacesInsideParentheses": "all",
+  "disallowSpaceAfterObjectKeys": true,
+  "requireSpaceBeforeObjectValues": true,
+  "requireCommaBeforeLineBreak": true,
+  "requireOperatorBeforeLineBreak": true,
+  "disallowSpaceAfterPrefixUnaryOperators": true,
+  "disallowSpaceBeforePostfixUnaryOperators": true,
+  "requireSpaceBeforeBinaryOperators": true,
+  "disallowImplicitTypeConversion": [
+    "numeric",
+    "binary",
+    "string"
+  ],
+  "requireCamelCaseOrUpperCaseIdentifiers": true,
+  "requireSpaceAfterBinaryOperators": true,
+  "disallowKeywords": [
+    "with"
+  ],
+  "disallowMultipleLineStrings": true,
+  "disallowMultipleLineBreaks": true,
+  "disallowMixedSpacesAndTabs": true,
+  "disallowTrailingWhitespace": true,
+  "maximumLineLength": 140,
+  "requireCapitalizedConstructors": true,
+  "requireDotNotation": true,
+  "disallowYodaConditions": true,
+  "disallowNewlineBeforeBlockStatements": true,
+  "validateLineBreaks": "LF",
+  "validateQuoteMarks": "'",
+  "validateIndentation": "\t",
+  "safeContextKeyword": [
+    "that"
+  ]
+}

+ 10 - 11
.jshintrc

@@ -1,13 +1,12 @@
 {
-	"browser": true,
-	"esnext": true,
-
-	"immed": true,
-	"loopfunc": true,
-	"noarg": true,
-	"nonbsp": true,
-	"undef": true,
-	"unused": true,
-	"strict": "global",
-	"varstmt": true
+  "browser": true,
+  "esnext": true,
+  "immed": true,
+  "loopfunc": true,
+  "noarg": true,
+  "nonbsp": true,
+  "undef": true,
+  "unused": true,
+  "strict": "implied",
+  "varstmt": true
 }

+ 20 - 14
README.md

@@ -4,35 +4,41 @@ CKEditor 5 – Development Repository
 [![Dependency Status](https://david-dm.org/ckeditor/ckeditor5.svg)](https://david-dm.org/ckeditor/ckeditor5)
 [![devDependency Status](https://david-dm.org/ckeditor/ckeditor5/dev-status.svg)](https://david-dm.org/ckeditor/ckeditor5#info=devDependencies)
 
-## Project Status (January 2016)
+## Project Status (July 2016)
 
-**WARNING:** The project is still at its first development stage. No usable software is currently available.
+Version 0.1.0 was released on July 14, 2016. This is the first developer preview of the new CKEditor 5, and the first demo-able version.
 
-[Periodic updates and news](https://github.com/ckeditor/ckeditor5/wiki/News-and-Updates) about the project can be found at the wiki pages of [ckeditor5](https://github.com/ckeditor/ckeditor5).
+**It is not production ready** and will be followed by several releases before it reaches its first stable 1.0.0 version.
+
+Read more in the [CKEditor 5 v0.1.0 release blog post](http://ckeditor.com/blog/First-Developer-Preview-of-CKEditor-5-Available).
+
+Check the basic CKEditor 5 sample on the [GitHub.io page](https://ckeditor5.github.io/).
+
+[Periodic updates and news](https://github.com/ckeditor/ckeditor5/wiki/News-and-Updates) about the project can be found on the wiki pages of [ckeditor5](https://github.com/ckeditor/ckeditor5).
 
 ## Project Organization
 
 ### Design
 
-Discussions, decisions and documentation about the architecture design of CKEditor 5 are made at the "ckeditor5-design" repository:
+Discussions, decisions and documentation about the architecture design of CKEditor 5 can be found in the "ckeditor5-design" repository:
 
 * Discussion: https://github.com/ckeditor/ckeditor5-design/issues
 * Documentation: https://github.com/ckeditor/ckeditor5-design/wiki
 
-At the current stage, this is the best place for bringing opinions and contributions. Letting the core team know if they are going in the right or wrong direction is great feedback.
+At the current stage, this is the best place for bringing opinions and contributions. Letting the core team know if they are going in the right or wrong direction is great feedback and will be much appreciated!
 
 ### Development
 
 The project is split into several different repositories, as described in the [design wiki](https://github.com/ckeditor/ckeditor5-design/wiki/Architecture-Overview). Most of these repositories are generally available within the CKEditor organization in GitHub, prefixed with "ckeditor5".
 
-The [ckeditor5](https://github.com/ckeditor/ckeditor5) repository is the place that centralizes the development of CKEditor 5. It bundles different repositories into a single place, adding the necessary helper tools for the development workflow, like the builder and the test runner. [Basic information on how to setup the development environment](https://github.com/ckeditor/ckeditor5/wiki/Development-Environment) can be found in the wiki pages.
+The [ckeditor5](https://github.com/ckeditor/ckeditor5) repository is the place that centralizes the development of CKEditor 5. It bundles different repositories into a single place, adding the necessary helper tools for the development workflow, like the builder and the test runner. [Basic information on how to set up the development environment](https://github.com/ckeditor/ckeditor5/wiki/Development-Environment) can be found in the wiki pages.
 
-The [ckeditor5](https://github.com/ckeditor/ckeditor5) repository contains also the core classes which implement the base architecture of the CKEditor 5 framework.
+The [ckeditor5](https://github.com/ckeditor/ckeditor5) repository also contains the core classes which implement the base architecture of the CKEditor 5 framework.
 
-Another key repositories are:
+Other key repositories are:
 
-* [ckeditor5-engine](https://github.com/ckeditor/ckeditor5-engine), which keeps the **editor's editing engine** (data model, editing and data views, etc.). Big part of the development happens in this repository, as the engine is the base of the editor.
-* [ckeditor5-ui](https://github.com/ckeditor/ckeditor5-ui) and [ckeditor5-ui-default](https://github.com/ckeditor/ckeditor5-ui-default), which keep the UI framework and default UI library (based on this framework). The official features use these packages to create their UI.
+* [ckeditor5-engine](https://github.com/ckeditor/ckeditor5-engine) – Stores the **editor's editing engine** (data model, editing and data views, etc.). A big part of the entire project development happens in this repository, as the engine is the base of the editor.
+* [ckeditor5-ui](https://github.com/ckeditor/ckeditor5-ui) and [ckeditor5-ui-default](https://github.com/ckeditor/ckeditor5-ui-default) – Stores the UI framework and the default UI library (based on this framework). The official features use these packages to create their UI.
 
 ![Diagram of CKEditor 5 key repositories](https://cloud.githubusercontent.com/assets/630060/13987605/a668a8c6-f108-11e5-839f-c2337c5f9c39.png)
 
@@ -40,10 +46,10 @@ Another key repositories are:
 
 Each repository independently handles its issues, so focus is kept on their scope:
 
-* [ckeditor5-design](https://github.com/ckeditor/ckeditor5-design): issues related to macro program design, not going into the specifics of other repos.
-* [ckeditor5](https://github.com/ckeditor/ckeditor5): issues related to the core API as well as the development environment and workflow. When you don't know where to report an issue, report it here.
-* [ckeditor5-engine](https://github.com/ckeditor/ckeditor5-engine): issues related to the engine API.
-* other [ckeditor5-*](https://github.com/ckeditor?utf8=%E2%9C%93&query=ckeditor5-) repos: issues related to all other parts of the code, like features, UI libraries, themes, etc.
+* [ckeditor5-design](https://github.com/ckeditor/ckeditor5-design) – Issues related to macro program design, not going into the specifics of other repos.
+* [ckeditor5](https://github.com/ckeditor/ckeditor5) – Issues related to the core API as well as the development environment and workflow. When you do not know where to report an issue, report it here.
+* [ckeditor5-engine](https://github.com/ckeditor/ckeditor5-engine) – Issues related to the engine API.
+* Other [ckeditor5-*](https://github.com/ckeditor?utf8=%E2%9C%93&query=ckeditor5-) repositories – Issues related to all other parts of the code, like features, UI libraries, themes, etc.
 
 ## License
 

+ 1 - 1
bender.js

@@ -1,4 +1,4 @@
-/* jshint browser: false, node: true */
+/* jshint browser: false, node: true, strict: true */
 
 'use strict';
 

+ 10 - 11
dev/.jshintrc

@@ -1,13 +1,12 @@
 {
-	"node": true,
-	"esnext": true,
-
-	"immed": true,
-	"loopfunc": true,
-	"noarg": true,
-	"nonbsp": true,
-	"undef": true,
-	"unused": true,
-	"strict": true,
-	"varstmt": true
+  "node": true,
+  "esnext": true,
+  "immed": true,
+  "loopfunc": true,
+  "noarg": true,
+  "nonbsp": true,
+  "undef": true,
+  "unused": true,
+  "strict": true,
+  "varstmt": true
 }

+ 1 - 1
dev/tasks/dev/templates/gulpfile.js

@@ -1,4 +1,4 @@
-/* jshint node: true */
+/* jshint browser: false, node: true, strict: true */
 
 'use strict';
 

+ 92 - 0
dev/tasks/exec/functions/remove-use-strict.js

@@ -0,0 +1,92 @@
+/**
+ * @license Copyright (c) 2003-2016, CKSource - Frederico Knabben. All rights reserved.
+ * For licensing, see LICENSE.md.
+ */
+
+'use strict';
+
+const gulp = require( 'gulp' );
+const path = require( 'path' );
+const replace = require( 'gulp-replace' );
+const filterGitignore = require( '../utils/filtergitignore' );
+const filter = require( 'gulp-filter' );
+const tools = require( '../../../utils/tools' );
+
+/**
+ * Removes lines with `'use strict';` directive.
+ *
+ * Example:
+ *
+ *		gulp exec --task remove-use-strict --include-root
+ *
+ * @param {String} workdir
+ * @returns {Stream}
+ */
+module.exports = function executeRemoveUseStrict( workdir ) {
+	updateJshintrc( workdir );
+	reformatOtherConfigs( workdir );
+
+	return removeUseStrict( workdir );
+};
+
+// Updates .jshintrc file's `strict` option with `implied` value.
+//
+// @param {String} workdir Path of directory to be processed.
+function updateJshintrc( workdir ) {
+	[ '/', 'tests/' ].forEach(
+		dir => {
+			const jshintrcPath = path.join( workdir, dir, '.jshintrc' );
+
+			tools.updateJSONFile( jshintrcPath, json => {
+				json.strict = 'implied';
+
+				return json;
+			} );
+		}
+	);
+}
+
+// Reformats (to match other .jshintrc files and package.json code style) the .jshintrc from dev/ and main .jscsrc.
+//
+// @param {String} workdir Path of directory to be processed.
+function reformatOtherConfigs( workdir ) {
+	tools.updateJSONFile( path.join( workdir, 'dev', '.jshintrc' ), json => json );
+	tools.updateJSONFile( path.join( workdir, '.jscsrc' ), json => json );
+}
+
+// Removes `'use strict';` directive from project's source files. Omits files listed in `.gitignore`.
+//
+// @param {String} workdir Path of directory to be processed.
+// @returns {Stream}
+function removeUseStrict( workdir ) {
+	const glob = path.join( workdir, '**/*.js' );
+	const filterDev = filter( '@(src|tests)/**/*.js', { restore: true } );
+	const filterGulpfileAndBender = filter(
+		[ 'gulpfile.js', 'dev/tasks/dev/templates/gulpfile.js', 'bender.js' ],
+		{ restore: true }
+	);
+
+	const useStrictRegex = /^\s*'use strict';\s*$/gm;
+	const jshintInlineConfigRegex = /\/\* jshint( browser: false,)? node: true \*\//;
+
+	return gulp.src( glob )
+		.pipe( filterGitignore() )
+
+		// Remove use strict from src/ and tests/.
+		.pipe( filterDev )
+		.pipe( replace(
+			useStrictRegex,
+			''
+		) )
+		.pipe( filterDev.restore )
+
+		// Fix gulpfile.js and bender.js.
+		.pipe( filterGulpfileAndBender )
+		.pipe( replace(
+			jshintInlineConfigRegex,
+			'/* jshint browser: false, node: true, strict: true */'
+		) )
+		.pipe( filterGulpfileAndBender.restore )
+
+		.pipe( gulp.dest( workdir ) );
+}

+ 30 - 0
dev/tasks/exec/functions/sh.js

@@ -0,0 +1,30 @@
+/**
+ * @license Copyright (c) 2003-2016, CKSource - Frederico Knabben. All rights reserved.
+ * For licensing, see LICENSE.md.
+ */
+
+'use strict';
+
+const tools = require( '../../../utils/tools' );
+
+/**
+ * Runs custom shell command over each package.
+ *
+ * Example:
+ *
+ *		gulp exec --task sh --cmd "sed 's/find/replace' file.js"
+ *
+ * @param {String} workdir
+ * @param {Object} params
+ */
+module.exports = function executeShellCommand( workdir, params ) {
+	// Needed to see results of commands printing to stdout/stderr.
+	const shouldLogOutput = true;
+	const cmd = params.cmd;
+
+	if ( !cmd ) {
+		throw new Error( 'You must provide command to execute with parameter: --cmd "command"' );
+	}
+
+	tools.shExec( cmd, shouldLogOutput );
+};

+ 6 - 1
dev/tasks/exec/tasks.js

@@ -23,6 +23,10 @@ const ckeditor5Dirs = require( '../../utils/ckeditor5-dirs' );
  *
  *		gulp exec --task task-name --repository ckeditor5-utils
  *
+ * Example of running task including root `ckeditor5` package
+ *
+ *		gulp exec --task task-name --include-root
+ *
  * @param {Object} config Task runner configuration.
  * @returns {Stream} Stream with processed files.
  */
@@ -75,8 +79,9 @@ function execute( execTask, ckeditor5Path, packageJSON, workspaceRoot, params )
 	const workspacePath = path.join( ckeditor5Path, workspaceRoot );
 	const mergedStream = merge();
 	const specificRepository = params.repository;
+	const includeRoot = !!params[ 'include-root' ];
 
-	let devDirectories = ckeditor5Dirs.getDevDirectories( workspacePath, packageJSON, ckeditor5Path );
+	let devDirectories = ckeditor5Dirs.getDevDirectories( workspacePath, packageJSON, ckeditor5Path, includeRoot );
 
 	if ( specificRepository ) {
 		devDirectories = devDirectories.filter( ( dir ) => {

+ 29 - 6
dev/tests/utils/ckeditor5-dirs.js

@@ -65,9 +65,9 @@ describe( 'utils', () => {
 				sandbox.stub( tools, 'getDirectories', () => sourceDirectories );
 				const directories = ckeditor5Dirs.getDirectories( workspacePath );
 
-				expect( directories.length ).equal( 2 );
-				expect( directories[ 0 ] ).equal( 'ckeditor5-core' );
-				expect( directories[ 1 ] ).equal( 'ckeditor5-plugin-image' );
+				expect( directories.length ).to.equal( 2 );
+				expect( directories[ 0 ] ).to.equal( 'ckeditor5-core' );
+				expect( directories[ 1 ] ).to.equal( 'ckeditor5-plugin-image' );
 			} );
 		} );
 
@@ -131,12 +131,35 @@ describe( 'utils', () => {
 
 				const directories = ckeditor5Dirs.getDevDirectories( workspacePath, packageJSONDependencies, ckeditor5Path );
 
-				expect( directories.length ).equal( 2 );
-				expect( directories[ 0 ] ).eql( {
+				expect( directories.length ).to.equal( 2 );
+				expect( directories[ 0 ] ).to.deep.equal( {
 						repositoryURL: 'ckeditor/ckeditor5-plugin-image',
 						repositoryPath: '/workspace/path/ckeditor5/node_modules/ckeditor5-plugin-image'
 					} );
-				expect( directories[ 1 ] ).eql( {
+				expect( directories[ 1 ] ).to.deep.equal( {
+						repositoryURL: 'ckeditor/ckeditor5-core',
+						repositoryPath: '/workspace/path/ckeditor5/node_modules/ckeditor5-core'
+					} );
+			} );
+
+			it( 'should return only ckeditor5 directories in development mode, including root directory', () => {
+				sandbox.stub( ckeditor5Dirs, 'getDirectories', () => sourceDirectories );
+				sandbox.stub( ckeditor5Dirs, 'getDependencies', () => dependencies );
+				sandbox.stub( git, 'parseRepositoryUrl' ).returns( repositoryInfo );
+				const includeRoot = true;
+
+				const directories = ckeditor5Dirs.getDevDirectories( workspacePath, packageJSONDependencies, ckeditor5Path, includeRoot );
+
+				expect( directories.length ).to.equal( 3 );
+				expect( directories[ 0 ] ).to.deep.equal( {
+						repositoryURL: 'ckeditor/ckeditor5',
+						repositoryPath: '/workspace/path/ckeditor5'
+					} );
+				expect( directories[ 1 ] ).to.deep.equal( {
+						repositoryURL: 'ckeditor/ckeditor5-plugin-image',
+						repositoryPath: '/workspace/path/ckeditor5/node_modules/ckeditor5-plugin-image'
+					} );
+				expect( directories[ 2 ] ).to.deep.equal( {
 						repositoryURL: 'ckeditor/ckeditor5-core',
 						repositoryPath: '/workspace/path/ckeditor5/node_modules/ckeditor5-core'
 					} );

+ 10 - 1
dev/utils/ckeditor5-dirs.js

@@ -72,9 +72,10 @@ module.exports = {
 	 * @param {String} workspacePath Absolute path to workspace.
 	 * @param {Object} packageJSON Contents of `ckeditor5` repo `package.json` file.
 	 * @param {String} ckeditor5Path Absolute path to ckeditor5 root directory.
+	 * @param {Boolean} includeRoot Include main `ckeditor5` package.
 	 * @returns {Array.<Object>}
 	 */
-	getDevDirectories( workspacePath, packageJSON, ckeditor5Path ) {
+	getDevDirectories( workspacePath, packageJSON, ckeditor5Path, includeRoot ) {
 		const directories = this.getDirectories( workspacePath );
 		const dependencies = this.getDependencies( packageJSON.dependencies );
 
@@ -94,6 +95,14 @@ module.exports = {
 			}
 		}
 
+		if ( includeRoot ) {
+			// Add root dependency and directory.
+			devDirectories.unshift( {
+				repositoryPath: ckeditor5Path,
+				repositoryURL: 'ckeditor/ckeditor5'
+			} );
+		}
+
 		return devDirectories;
 	}
 };

+ 1 - 1
gulpfile.js

@@ -1,4 +1,4 @@
-/* jshint node: true */
+/* jshint browser: false, node: true, strict: true */
 
 'use strict';
 

+ 0 - 1
package.json

@@ -9,7 +9,6 @@
   ],
   "dependencies": {
     "ckeditor5-basic-styles": "ckeditor/ckeditor5-basic-styles",
-    "ckeditor5-delete": "ckeditor/ckeditor5-delete",
     "ckeditor5-editor-classic": "ckeditor/ckeditor5-editor-classic",
     "ckeditor5-engine": "ckeditor/ckeditor5-engine",
     "ckeditor5-enter": "ckeditor/ckeditor5-enter",

+ 0 - 2
src/command/attributecommand.js

@@ -3,8 +3,6 @@
  * For licensing, see LICENSE.md.
  */
 
-'use strict';
-
 import Command from './command.js';
 import TreeWalker from '../engine/model/treewalker.js';
 import Range from '../engine/model/range.js';

+ 0 - 2
src/command/command.js

@@ -3,8 +3,6 @@
  * For licensing, see LICENSE.md.
  */
 
-'use strict';
-
 import ObservableMixin from '../utils/observablemixin.js';
 import mix from '../utils/mix.js';
 

+ 0 - 2
src/editor/editor.js

@@ -3,8 +3,6 @@
  * For licensing, see LICENSE.md.
  */
 
-'use strict';
-
 import EmitterMixin from '../utils/emittermixin.js';
 import Config from '../utils/config.js';
 import PluginCollection from '../plugincollection.js';

+ 0 - 2
src/editor/standardeditor.js

@@ -3,8 +3,6 @@
  * For licensing, see LICENSE.md.
  */
 
-'use strict';
-
 import Editor from './editor.js';
 import KeystrokeHandler from '../keystrokehandler.js';
 import EditingController from '../engine/editingcontroller.js';

+ 0 - 2
src/feature.js

@@ -3,8 +3,6 @@
  * For licensing, see LICENSE.md.
  */
 
-'use strict';
-
 import Plugin from './plugin.js';
 
 /**

+ 0 - 2
src/keystrokehandler.js

@@ -3,8 +3,6 @@
  * For licensing, see LICENSE.md.
  */
 
-'use strict';
-
 import EmitterMixin from './utils/emittermixin.js';
 import { getCode, parseKeystroke } from './utils/keyboard.js';
 

+ 0 - 2
src/load__amd.js

@@ -3,8 +3,6 @@
  * For licensing, see LICENSE.md.
  */
 
-'use strict';
-
 // We import the 'require' module, so Require.JS gives us a localized version of require().
 // Otherwise we would use the global one which resolves paths relatively to the base dir.
 import require from 'require';

+ 0 - 2
src/load__cjs.js

@@ -3,8 +3,6 @@
  * For licensing, see LICENSE.md.
  */
 
-'use strict';
-
 /* global require */
 
 export default function load( modulePath ) {

+ 0 - 2
src/load__esnext.js

@@ -3,8 +3,6 @@
  * For licensing, see LICENSE.md.
  */
 
-'use strict';
-
 /* global System */
 
 export default function load( modulePath ) {

+ 0 - 2
src/plugin.js

@@ -3,8 +3,6 @@
  * For licensing, see LICENSE.md.
  */
 
-'use strict';
-
 import ObservableMixin from './utils/observablemixin.js';
 import mix from './utils/mix.js';
 

+ 0 - 2
src/plugincollection.js

@@ -3,8 +3,6 @@
  * For licensing, see LICENSE.md.
  */
 
-'use strict';
-
 import Plugin from './plugin.js';
 import CKEditorError from './utils/ckeditorerror.js';
 import log from './utils/log.js';

+ 21 - 23
tests/.jshintrc

@@ -1,25 +1,23 @@
 {
-	"browser": true,
-	"esnext": true,
-
-	"expr": true,
-	"immed": true,
-	"loopfunc": true,
-	"noarg": true,
-	"nonbsp": true,
-	"strict": "global",
-	"undef": true,
-	"unused": true,
-	"varstmt": true,
-
-	"globals": {
-		"after": false,
-		"afterEach": false,
-		"before": false,
-		"beforeEach": false,
-		"describe": false,
-		"expect": false,
-		"it": false,
-		"sinon": false
-	}
+  "browser": true,
+  "esnext": true,
+  "expr": true,
+  "immed": true,
+  "loopfunc": true,
+  "noarg": true,
+  "nonbsp": true,
+  "strict": "implied",
+  "undef": true,
+  "unused": true,
+  "varstmt": true,
+  "globals": {
+    "after": false,
+    "afterEach": false,
+    "before": false,
+    "beforeEach": false,
+    "describe": false,
+    "expect": false,
+    "it": false,
+    "sinon": false
+  }
 }

+ 0 - 2
tests/_utils-tests/classictesteditor.js

@@ -3,8 +3,6 @@
  * For licensing, see LICENSE.md.
  */
 
-'use strict';
-
 import StandardEditor from '/ckeditor5/editor/standardeditor.js';
 import ClassicTestEditor from '/tests/ckeditor5/_utils/classictesteditor.js';
 import HtmlDataProcessor from '/ckeditor5/engine/dataprocessor/htmldataprocessor.js';

+ 0 - 2
tests/_utils-tests/createsinonsandbox.js

@@ -3,8 +3,6 @@
  * For licensing, see LICENSE.md.
  */
 
-'use strict';
-
 import testUtils from '/tests/ckeditor5/_utils/utils.js';
 
 const obj = {

+ 0 - 2
tests/_utils-tests/modeltesteditor.js

@@ -3,8 +3,6 @@
  * For licensing, see LICENSE.md.
  */
 
-'use strict';
-
 import Editor from '/ckeditor5/editor/editor.js';
 import ModelTestEditor from '/tests/ckeditor5/_utils/modeltesteditor.js';
 import HtmlDataProcessor from '/ckeditor5/engine/dataprocessor/htmldataprocessor.js';

+ 0 - 2
tests/_utils-tests/module__amd.js

@@ -5,8 +5,6 @@
 
 /* global require, bender */
 
-'use strict';
-
 import testUtils from '/tests/ckeditor5/_utils/utils.js';
 import moduleTestUtils from '/tests/ckeditor5/_utils/module.js';
 

+ 0 - 2
tests/_utils-tests/module__cjs.js

@@ -5,8 +5,6 @@
 
 /* global require, process */
 
-'use strict';
-
 import testUtils from '/tests/ckeditor5/_utils/utils.js';
 import moduleTestUtils from '/tests/ckeditor5/_utils/module.js';
 

+ 0 - 2
tests/_utils-tests/virtualtesteditor.js

@@ -3,8 +3,6 @@
  * For licensing, see LICENSE.md.
  */
 
-'use strict';
-
 import StandardEditor from '/ckeditor5/editor/standardeditor.js';
 import VirtualTestEditor from '/tests/ckeditor5/_utils/virtualtesteditor.js';
 import HtmlDataProcessor from '/ckeditor5/engine/dataprocessor/htmldataprocessor.js';

+ 0 - 2
tests/_utils/classictesteditor.js

@@ -3,8 +3,6 @@
  * For licensing, see LICENSE.md.
  */
 
-'use strict';
-
 import StandardEditor from '/ckeditor5/editor/standardeditor.js';
 
 import HtmlDataProcessor from '/ckeditor5/engine/dataprocessor/htmldataprocessor.js';

+ 0 - 2
tests/_utils/modeltesteditor.js

@@ -3,8 +3,6 @@
  * For licensing, see LICENSE.md.
  */
 
-'use strict';
-
 import Editor from '/ckeditor5/editor/editor.js';
 import HtmlDataProcessor from '/ckeditor5/engine/dataprocessor/htmldataprocessor.js';
 

+ 0 - 2
tests/_utils/module__amd.js

@@ -5,8 +5,6 @@
 
 /* globals bender, define, require */
 
-'use strict';
-
 /**
  * AMD tools related to CKEditor.
  */

+ 0 - 2
tests/_utils/module__cjs.js

@@ -5,8 +5,6 @@
 
 /* globals require, process */
 
-'use strict';
-
 const mockery = require( 'mockery' );
 mockery.enable( {
 	warnOnReplace: false,

+ 0 - 2
tests/_utils/utils.js

@@ -3,8 +3,6 @@
  * For licensing, see LICENSE.md.
  */
 
-'use strict';
-
 /**
  * General test utils for CKEditor.
  */

+ 0 - 2
tests/_utils/virtualtesteditor.js

@@ -3,8 +3,6 @@
  * For licensing, see LICENSE.md.
  */
 
-'use strict';
-
 import StandardEditor from '/ckeditor5/editor/standardeditor.js';
 import HtmlDataProcessor from '/ckeditor5/engine/dataprocessor/htmldataprocessor.js';
 

+ 30 - 17
tests/command/attributecommand.js

@@ -3,8 +3,6 @@
  * For licensing, see LICENSE.md.
  */
 
-'use strict';
-
 import Editor from '/ckeditor5/editor/editor.js';
 import Document from '/ckeditor5/engine/model/document.js';
 import AttributeCommand from '/ckeditor5/command/attributecommand.js';
@@ -12,6 +10,8 @@ import Text from '/ckeditor5/engine/model/text.js';
 import Range from '/ckeditor5/engine/model/range.js';
 import Position from '/ckeditor5/engine/model/position.js';
 import Element from '/ckeditor5/engine/model/element.js';
+import writer from '/ckeditor5/engine/model/writer.js';
+import { itemAt } from '/tests/engine/model/_utils/utils.js';
 
 let editor, command, modelDoc, root;
 
@@ -62,7 +62,15 @@ describe( '_doExecute', () => {
 		let attrs = {};
 		attrs[ attrKey ] = true;
 
-		root.insertChildren( 0, [ new Element( 'p', [] , [ 'abc', new Text( 'foobar', attrs ), 'xyz' ] ), new Element( 'p' ) ] );
+		root.insertChildren( 0, [
+			new Element( 'p', [] , [
+				new Text( 'abc' ),
+				new Text( 'foobar', attrs ),
+				new Text( 'xyz' )
+			] ),
+			new Element( 'p' )
+		] );
+
 		p = root.getChild( 0 );
 	} );
 
@@ -74,8 +82,10 @@ describe( '_doExecute', () => {
 		command._doExecute();
 
 		expect( command.value ).to.be.true;
-		expect( p.getChild( 1 ).hasAttribute( attrKey ) ).to.be.true;
-		expect( p.getChild( 2 ).hasAttribute( attrKey ) ).to.be.true;
+
+		expect( p.getChild( 0 ).hasAttribute( attrKey ) ).to.be.false;
+		expect( itemAt( p, 1 ).hasAttribute( attrKey ) ).to.be.true;
+		expect( itemAt( p, 2 ).hasAttribute( attrKey ) ).to.be.true;
 	} );
 
 	it( 'should remove attribute from selected nodes if the command value was true', () => {
@@ -86,9 +96,9 @@ describe( '_doExecute', () => {
 		command._doExecute();
 
 		expect( command.value ).to.be.false;
-		expect( p.getChild( 3 ).hasAttribute( attrKey ) ).to.be.false;
-		expect( p.getChild( 4 ).hasAttribute( attrKey ) ).to.be.false;
-		expect( p.getChild( 5 ).hasAttribute( attrKey ) ).to.be.false;
+		expect( itemAt( p, 3 ).hasAttribute( attrKey ) ).to.be.false;
+		expect( itemAt( p, 4 ).hasAttribute( attrKey ) ).to.be.false;
+		expect( itemAt( p, 5 ).hasAttribute( attrKey ) ).to.be.false;
 	} );
 
 	it( 'should add attribute on selected nodes if execute parameter was set to true', () => {
@@ -99,7 +109,7 @@ describe( '_doExecute', () => {
 		command._doExecute( true );
 
 		expect( command.value ).to.be.true;
-		expect( p.getChild( 9 ).hasAttribute( attrKey ) ).to.be.true;
+		expect( itemAt( p, 9 ).hasAttribute( attrKey ) ).to.be.true;
 	} );
 
 	it( 'should remove attribute on selected nodes if execute parameter was set to false', () => {
@@ -110,8 +120,8 @@ describe( '_doExecute', () => {
 		command._doExecute( false );
 
 		expect( command.value ).to.be.false;
-		expect( p.getChild( 3 ).hasAttribute( attrKey ) ).to.be.false;
-		expect( p.getChild( 4 ).hasAttribute( attrKey ) ).to.be.false;
+		expect( itemAt( p, 3 ).hasAttribute( attrKey ) ).to.be.false;
+		expect( itemAt( p, 4 ).hasAttribute( attrKey ) ).to.be.false;
 	} );
 
 	it( 'should change selection attribute if selection is collapsed in non-empty parent', () => {
@@ -174,8 +184,9 @@ describe( '_doExecute', () => {
 	} );
 
 	it( 'should not apply attribute change where it would invalid schema', () => {
-		p.insertChildren( 3, new Element( 'image' ) );
-		p.insertChildren( 12, new Element( 'image' ) );
+		writer.insert( Position.createFromParentAndOffset( p, 3 ), new Element( 'image' ) );
+		writer.insert( Position.createFromParentAndOffset( p, 12 ), new Element( 'image' ) );
+
 		modelDoc.selection.setRanges( [ new Range( new Position( root, [ 0, 2 ] ), new Position( root, [ 0, 13 ] ) ) ] );
 
 		expect( command.isEnabled ).to.be.true;
@@ -184,8 +195,10 @@ describe( '_doExecute', () => {
 
 		let expectedHas = [ 0, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0 ];
 
-		for ( let i = 0; i < expectedHas.length; i++ ) {
-			expect( p.getChild( i ).hasAttribute( attrKey ) ).to.equal( !!expectedHas[ i ] );
+		let i = 0;
+
+		for ( let node of Range.createFromElement( p ).getItems( { singleCharacters: true } ) ) {
+			expect( node.hasAttribute( attrKey ) ).to.equal( !!expectedHas[ i++ ] );
 		}
 	} );
 } );
@@ -194,10 +207,10 @@ describe( '_checkEnabled', () => {
 	beforeEach( () => {
 		root.insertChildren( 0, [
 			new Element( 'p', [], [
-				'foo',
+				new Text( 'foo' ),
 				new Element( 'img' ),
 				new Element( 'img' ),
-				'bar'
+				new Text( 'bar' )
 			] ),
 			new Element( 'h1' ),
 			new Element( 'p' )

+ 0 - 2
tests/command/command.js

@@ -3,8 +3,6 @@
  * For licensing, see LICENSE.md.
  */
 
-'use strict';
-
 import Editor from '/ckeditor5/editor/editor.js';
 import Command from '/ckeditor5/command/command.js';
 

+ 0 - 2
tests/editor/editor-base.js

@@ -5,8 +5,6 @@
 
 /* bender-tags: editor */
 
-'use strict';
-
 import Editor from '/ckeditor5/editor/editor.js';
 import Command from '/ckeditor5/command/command.js';
 import Locale from '/ckeditor5/utils/locale.js';

+ 0 - 2
tests/editor/editor.js

@@ -5,8 +5,6 @@
 
 /* bender-tags: editor, browser-only */
 
-'use strict';
-
 import moduleUtils from '/tests/ckeditor5/_utils/module.js';
 import Editor from '/ckeditor5/editor/editor.js';
 import Plugin from '/ckeditor5/plugin.js';

+ 0 - 2
tests/editor/standardeditor.js

@@ -5,8 +5,6 @@
 
 /* bender-tags: editor, browser-only */
 
-'use strict';
-
 import StandardEditor from '/ckeditor5/editor/standardeditor.js';
 import HtmlDataProcessor from '/ckeditor5/engine/dataprocessor/htmldataprocessor.js';
 import { getData, setData } from '/tests/engine/_utils/model.js';

+ 0 - 2
tests/keystrokehandler.js

@@ -5,8 +5,6 @@
 
 /* bender-tags: browser-only */
 
-'use strict';
-
 import VirtualTestEditor from '/tests/ckeditor5/_utils/virtualtesteditor.js';
 import KeystrokeHandler from '/ckeditor5/keystrokehandler.js';
 import { keyCodes } from '/ckeditor5/utils/keyboard.js';

+ 0 - 2
tests/load.js

@@ -3,8 +3,6 @@
  * For licensing, see LICENSE.md.
  */
 
-'use strict';
-
 import load from '/ckeditor5/load.js';
 
 describe( 'load()', () => {

+ 0 - 2
tests/plugin.js

@@ -3,8 +3,6 @@
  * For licensing, see LICENSE.md.
  */
 
-'use strict';
-
 import Plugin from '/ckeditor5/plugin.js';
 import Editor from '/ckeditor5/editor/editor.js';
 

+ 0 - 2
tests/plugincollection.js

@@ -5,8 +5,6 @@
 
 /* bender-tags: browser-only */
 
-'use strict';
-
 import moduleUtils from '/tests/ckeditor5/_utils/module.js';
 import testUtils from '/tests/ckeditor5/_utils/utils.js';
 import Editor from '/ckeditor5/editor/editor.js';