浏览代码

Merge branch 'master' into t/ckeditor5-build-balloon-block/1

Aleksander Nowodzinski 6 年之前
父节点
当前提交
d4a5cf25d9

+ 20 - 18
.travis.yml

@@ -3,34 +3,36 @@ dist: trusty
 addons:
   apt:
     sources:
-      - google-chrome
+    - google-chrome
     packages:
-      - google-chrome-stable
+    - google-chrome-stable
 language: node_js
+cache:
+  yarn: true
 node_js:
-  - "8"
+- "8"
 cache:
-  - node_modules
+- node_modules
 before_install:
-  - export DISPLAY=:99.0
-  - sh -e /etc/init.d/xvfb start
-  - npm config set package-lock false
-  - npm i -g npm@^5.7.1
+- export DISPLAY=:99.0
+- sh -e /etc/init.d/xvfb start
+- npm i -g yarn
 install:
-  - npm install
-  - npm install mgit2 lerna
-  - mgit bootstrap --resolver-url-template="https://github.com/\${ path }.git"
-  - lerna bootstrap
+- yarn add mgit2 --ignore-workspace-root-check
+- mgit sync --resolver-url-template="https://github.com/\${ path }.git"
+- git checkout package.json yarn.lock
+- rm -rf node_modules
+- yarn install
 script:
-  - npm t -- --reporter=dots
-  - npm run docs:api -- --validate-only
-  - 'if [ $TRAVIS_TEST_RESULT -eq 0 ]; then
-  	  travis_wait npm run docs:build-and-publish-nightly;
-    fi'
+- yarn run test --reporter=dots
+- yarn run docs:api --validate-only
+- 'if [ $TRAVIS_TEST_RESULT -eq 0 ]; then
+    travis_wait yarn run docs:build-and-publish-nightly;
+  fi'
 notifications:
   slack:
     rooms:
-      - secure: NKUpSnmkmlRRua0URoQJjEqNfIHx6tuqJhVCbQ6vU5rdUdw6A43OfG7Qym3MRQlXymFuIF0MUsOrS6t0GeXE9hSpC+5ynF02E5wdTD1/R7Tjq0XEdx0mXJTYjuOQA16fvwMxm5p3Ub5uWpSH+gBtyG86UPCbVSxDvvmxHqResAw=
+    - secure: NKUpSnmkmlRRua0URoQJjEqNfIHx6tuqJhVCbQ6vU5rdUdw6A43OfG7Qym3MRQlXymFuIF0MUsOrS6t0GeXE9hSpC+5ynF02E5wdTD1/R7Tjq0XEdx0mXJTYjuOQA16fvwMxm5p3Ub5uWpSH+gBtyG86UPCbVSxDvvmxHqResAw=
     on_success: change
     on_failure: always
     on_pull_requests: false

+ 1 - 1
docs/builds/guides/development/custom-builds.md

@@ -147,7 +147,7 @@ After you changed the webpack entry file or updated some dependencies, it is tim
 To do that, execute the following command:
 
 ```bash
-npm run build
+yarn run build
 ```
 
 You can validate whether your new build works by opening the `sample/index.html` file in a browser (via HTTP, not as a local file). Make sure to **clear the cache**.

+ 39 - 1
docs/builds/guides/frameworks/vuejs.md

@@ -193,7 +193,7 @@ npm install --save \
     @ckeditor/ckeditor5-dev-webpack-plugin \
     @ckeditor/ckeditor5-dev-utils \
     postcss-loader \
-    raw-loader
+    raw-loader@0.5.1
 ```
 
 Edit the `vue.config.js` file and use the following configuration. If the file is not present, create it in the root of the application (i.e. next to `package.json`):
@@ -340,6 +340,44 @@ Now all you need to do is specify the list of rich text editor options (**includ
 </script>
 ```
 
+## Using the Document editor build
+
+If you use the {@link framework/guides/document-editor Document editor} in your application, you need to {@link module:editor-decoupled/decouplededitor~DecoupledEditor.create manually add the editor toolbar to the DOM}.
+
+Since accessing the editor toolbar is not possible until after the editor instance is {@link module:core/editor/editor~Editor#event:ready ready}, put your toolbar insertion code in a method executed upon the [`ready`](#ready) event of the component, like in the following example:
+
+```html
+<template>
+		<div id="app">
+			<ckeditor :editor="editor" @ready="onReady" ... ></ckeditor>
+		</div>
+</template>
+
+<script>
+	import DecoupledEditor from '@ckeditor/ckeditor5-build-decoupled-document';
+
+	export default {
+		name: 'app',
+		data() {
+			return {
+				editor: DecoupledEditor,
+
+				// ...
+			};
+		},
+		methods: {
+			onReady( editor )  {
+				// Insert the toolbar before the editable area.
+				editor.ui.view.editable.element.parentElement.insertBefore(
+					editor.ui.view.toolbar.element,
+					editor.ui.view.editable.element
+				);
+			}
+		}
+	}
+</script>
+```
+
 ## Component directives
 
 ### `editor`

+ 1 - 1
docs/builds/guides/integration/advanced-setup.md

@@ -560,7 +560,7 @@ index c57e371..04fc9fe 100644
 Once you changed the `src/ckeditor.js` and `webpack.config.js` files it is time to rebuild the build:
 
 ```bash
-npm run build
+yarn run build
 ```
 
 Finally, when webpack finishes compiling your super build, you can change the `samples/index.html` file to test both editors:

+ 1 - 1
docs/builds/guides/integration/installing-plugins.md

@@ -123,7 +123,7 @@ ClassicEditor.defaultConfig = {
 Finally, bundle the build:
 
 ```bash
-npm run build
+yarn run build
 ```
 
 If everything worked, the editor build (which is available in the `build/` directory) should be updated.

+ 1 - 1
docs/examples/builds/balloon-editor.md

@@ -5,6 +5,6 @@ order: 30
 
 # Balloon editor
 
-{@link builds/guides/overview#balloon-editor Balloon editor} lets you create your content directly in its target location with the help of a balloon toolbar that apprears next to the selected editable document element.
+{@link builds/guides/overview#balloon-editor Balloon editor} lets you create your content directly in its target location with the help of a balloon toolbar that appears next to the selected editable document element.
 
 {@snippet examples/balloon-editor}

+ 1 - 1
docs/features/image-upload.md

@@ -23,7 +23,7 @@ The software that makes the image upload possible is called an **upload adapter*
 * [**Custom upload adapters**](#implementing-your-own-upload-adapter) &ndash; Create your own upload adapter from scratch using the open API architecture of CKEditor 5.
 
 <info-box>
-	If you want to get a better look under the hood and learn more about the upload process, you can check out the {@link framework/guides/deep-dive/upload-adapter "Custom image upload adapter" deep dive guide}.
+	If you want to get a better look under the hood and learn more about the upload process, you can check out the {@link framework/guides/deep-dive/upload-adapter "Custom image upload adapter" deep dive guide} covering that topic.
 </info-box>
 
 ## Demo

+ 1 - 1
docs/framework/guides/contributing/contributing.md

@@ -87,7 +87,7 @@ Some additional things you should keep in mind:
 * Make sure you signed the [Contributor License Agreement (CLA)](#contributor-license-agreement-cla) and that tests pass. Test your changes!
 
 <info-box>
-	If want your changes to be permanent in your development environment, make sure your `mgit.json` file {@link framework/guides/contributing/development-environment#using-mgit-for-custom-packages points to your forked version of the repository} so next time you execute `mgit update` to refresh the project, the utility will use your fork.
+	If want your changes to be permanent in your development environment, make sure your `mgit.json` file {@link framework/guides/contributing/development-environment#using-mgit-for-custom-packages points to your forked version of the repository} so next time you execute `mgit sync` to refresh the project, the utility will use your fork.
 </info-box>
 
 ## Translating

+ 71 - 55
docs/framework/guides/contributing/development-environment.md

@@ -8,7 +8,7 @@ order: 10
 The CKEditor 5 codebase is divided into multiple [npm](http://npmjs.com/) packages, each developed in a separate Git repository. The main package is [`ckeditor5`](https://github.com/ckeditor/ckeditor5) which installs all project dependencies and various development-related resources such as:
 
 * the testing environment setup,
-* configuration for [mgit](https://www.npmjs.com/package/mgit2) (a multi-repo management tool) and [Lerna.js](https://github.com/lerna/lerna) (a multi-package management tool),
+* configuration for [mgit](https://www.npmjs.com/package/mgit2) (a multi-repo management tool) and [Yarn](https://yarnpkg.com/) (a dependency management tool),
 * translation management tools,
 * documentation generator,
 * and release tools.
@@ -20,23 +20,22 @@ You can find all the official packages listed in [CKEditor 5 development reposit
 In order to start developing CKEditor 5 you will require:
 
 * [Node.js](https://nodejs.org/en/) 6.9.0+
-* npm 4+ (**note:** some npm 5+ versions were known to cause [problems](https://github.com/npm/npm/issues/16991), especially with deduplicating packages; upgrade npm when in doubt)
 * [Git](https://git-scm.com/)
 
 ## Setting up the CKEditor development environment
 
 First, you need to install a couple of tools which you will be using later:
 
-* [mgit](https://www.npmjs.com/package/mgit2) &ndash; A multi-repo management tool,
-* [Lerna.js](https://github.com/lerna/lerna)@2 &ndash; A multi-package management tool. Note: Lerna@3 is [not supported yet](https://github.com/ckeditor/ckeditor5/issues/1214).
+* [mgit2](https://www.npmjs.com/package/mgit2) &mdash; A multi-repo management tool,
+* [Yarn](https://yarnpkg.com/) &mdash; A dependency management tool.
 
 It is best to install them globally in your system for an easier use later on:
 
 ```bash
-npm install -g lerna@2 mgit2
+npm install -g yarn mgit2
 ```
 
-Note: You may need to use `sudo` on Linux and macOS.
+**Note:** [Read how to avoid using `sudo` to install packages globally](https://github.com/sindresorhus/guides/blob/master/npm-global-without-sudo.md) or use [nvm](https://github.com/creationix/nvm).
 
 Then clone the [main repository](https://github.com/ckeditor/ckeditor5):
 
@@ -50,21 +49,19 @@ And install all CKEditor 5 packages from the [npm registry](http://npmjs.com/).
 **Note:** If you plan to use the developement version of CKEditor 5 packages (see the [next section](#switching-to-development-version-of-packages)), you can skip this step to save time.
 
 ```bash
-npm install
+yarn install
 ```
 
-This may take a [while](https://github.com/npm/npm/issues/10380)...
-
 ### Switching to development version of packages
 
 The steps above should install all the packages from npm, which means that you will have the latest releases of all of them. They are available in `node_modules/@ckeditor/` (we are using [scoped packages](https://docs.npmjs.com/misc/scope), hence the unusual directory).
 
-In order to work with development versions of all the official packages, it is recommended to use mgit and Lerna. The former will clone all package repositories and the latter will be able to symlink them, so they create a correct directory structure, understandable by Node.js-compliant tools (like webpack or Browserify).
+In order to work with development versions of all the official packages, it is recommended to use mgit. This tool will clone all package repositories to the `packages/` directory. Then, those packages need to be installed in a way understandable by Node.js-compliant tools (like webpack or Browserify). In order to achieve that we use Yarn's feature called [workspaces](https://yarnpkg.com/lang/en/docs/workspaces/) which creates symlinks to these packages.
 
 First, clone all the repositories:
 
 ```bash
-mgit bootstrap
+mgit sync
 ```
 
 Expected result:
@@ -79,30 +76,57 @@ packages/
 └── ckeditor5-utils
 ```
 
-Finally, link them:
+Finally, install all external dependencies (such as the test runner) and create symlinks to CKEditor 5 packages available in the `packages/` directory with this one command:
 
 ```bash
-lerna bootstrap
+yarn install
 ```
 
-Running Lerna may take a while because it installs all package dependencies. It will also warn you about circular dependencies between packages which you can ignore.
-
-Now, all CKEditor packages (except the [development tools](https://github.com/ckeditor/ckeditor5-dev)) should be cross-symlinked:
+You can check that CKEditor 5 packages which are part of the development environment (so those except [development tools](https://github.com/ckeditor/ckeditor5-dev) and some closed source packages) should be linked:
 
 ```bash
-(master 340feac) p@m /workspace/ckeditor5> ls -la node_modules/\@ckeditor/ckeditor5-utils/node_modules/\@ckeditor/
-total 16
-drwxr-xr-x    5 p  staff   170 31 Jan 10:37 .
-drwxr-xr-x  292 p  staff  9928 20 Jan 00:20 ..
-lrwxr-xr-x    1 p  staff    23 31 Jan 10:37 ckeditor5-core -> ../../../ckeditor5-core
-drwxr-xr-x    7 p  staff   238 20 Jan 00:20 ckeditor5-dev-docs
-lrwxr-xr-x    1 p  staff    25 31 Jan 10:37 ckeditor5-engine -> ../../../ckeditor5-engine
+(master ae6f43a) p@m /workspace/misc/ckeditor5> ls -la node_modules/\@ckeditor/
+total 0
+drwxr-xr-x    54 p  staff   1728 11 sty 14:41 .
+drwxr-xr-x  1115 p  staff  35680 11 sty 14:41 ..
+drwxr-xr-x     7 p  staff    224 11 sty 14:41 ckeditor-cloud-services-collaboration
+drwxr-xr-x     6 p  staff    192 11 sty 14:41 ckeditor-cloud-services-core
+lrwxr-xr-x     1 p  staff     41 11 sty 14:41 ckeditor5-adapter-ckfinder -> ../../packages/ckeditor5-adapter-ckfinder
+lrwxr-xr-x     1 p  staff     34 11 sty 14:41 ckeditor5-alignment -> ../../packages/ckeditor5-alignment
+lrwxr-xr-x     1 p  staff     35 11 sty 14:41 ckeditor5-autoformat -> ../../packages/ckeditor5-autoformat
+lrwxr-xr-x     1 p  staff     33 11 sty 14:41 ckeditor5-autosave -> ../../packages/ckeditor5-autosave
+lrwxr-xr-x     1 p  staff     37 11 sty 14:41 ckeditor5-basic-styles -> ../../packages/ckeditor5-basic-styles
+lrwxr-xr-x     1 p  staff     36 11 sty 14:41 ckeditor5-block-quote -> ../../packages/ckeditor5-block-quote
+lrwxr-xr-x     1 p  staff     38 11 sty 14:41 ckeditor5-build-balloon -> ../../packages/ckeditor5-build-balloon
+lrwxr-xr-x     1 p  staff     38 11 sty 14:41 ckeditor5-build-classic -> ../../packages/ckeditor5-build-classic
+lrwxr-xr-x     1 p  staff     49 11 sty 14:41 ckeditor5-build-decoupled-document -> ../../packages/ckeditor5-build-decoupled-document
+lrwxr-xr-x     1 p  staff     37 11 sty 14:41 ckeditor5-build-inline -> ../../packages/ckeditor5-build-inline
+lrwxr-xr-x     1 p  staff     33 11 sty 14:41 ckeditor5-ckfinder -> ../../packages/ckeditor5-ckfinder
+lrwxr-xr-x     1 p  staff     34 11 sty 14:41 ckeditor5-clipboard -> ../../packages/ckeditor5-clipboard
+lrwxr-xr-x     1 p  staff     39 11 sty 14:41 ckeditor5-cloud-services -> ../../packages/ckeditor5-cloud-services
+drwxr-xr-x     7 p  staff    224 11 sty 14:41 ckeditor5-collaboration-core
+drwxr-xr-x     7 p  staff    224 11 sty 14:41 ckeditor5-comments
+lrwxr-xr-x     1 p  staff     29 11 sty 14:41 ckeditor5-core -> ../../packages/ckeditor5-core
+drwxr-xr-x     8 p  staff    256 11 sty 14:41 ckeditor5-dev-docs
+drwxr-xr-x     9 p  staff    288 11 sty 14:41 ckeditor5-dev-env
+drwxr-xr-x     9 p  staff    288 11 sty 14:41 ckeditor5-dev-tests
+drwxr-xr-x     8 p  staff    256 11 sty 14:41 ckeditor5-dev-utils
+drwxr-xr-x     8 p  staff    256 11 sty 14:41 ckeditor5-dev-webpack-plugin
+lrwxr-xr-x     1 p  staff     35 11 sty 14:41 ckeditor5-easy-image -> ../../packages/ckeditor5-easy-image
+lrwxr-xr-x     1 p  staff     39 11 sty 14:41 ckeditor5-editor-balloon -> ../../packages/ckeditor5-editor-balloon
+lrwxr-xr-x     1 p  staff     39 11 sty 14:41 ckeditor5-editor-classic -> ../../packages/ckeditor5-editor-classic
+lrwxr-xr-x     1 p  staff     41 11 sty 14:41 ckeditor5-editor-decoupled -> ../../packages/ckeditor5-editor-decoupled
+lrwxr-xr-x     1 p  staff     38 11 sty 14:41 ckeditor5-editor-inline -> ../../packages/ckeditor5-editor-inline
+lrwxr-xr-x     1 p  staff     31 11 sty 14:41 ckeditor5-engine -> ../../packages/ckeditor5-engine
+lrwxr-xr-x     1 p  staff     30 11 sty 14:41 ckeditor5-enter -> ../../packages/ckeditor5-enter
+
+... and so on
 ```
 
 If everything worked correctly, you should be able to run some tests:
 
 ```bash
-npm run test -- --files=core
+yarn run test --files=core
 ```
 
 ### Fetching changes
@@ -114,51 +138,43 @@ Whenever you want to update all packages to their latest versions call:
 git pull
 
 # To update pull changes to all the packages:
-mgit update
+mgit sync
 ```
 
-From time to time, if the list of dependencies in any of the packages changed, you will need to call Lerna again to symlink them:
+From time to time, if the list of dependencies in any of the packages changed, you will need to call Yarn again to symlink them:
 
 ```bash
-lerna bootstrap
+yarn install
 ```
 
-You can also speed it up if you know which package has changed:
+### Working with multiple repositories
 
-```bash
-lerna bootstrap --scope=@ckeditor/ckeditor5-core
-```
+Mgit implements many useful commands, such as:
 
-### Using mgit for custom packages
+* `mgit exec 'command'` – executing a shell command in all repositories,
+* `mgit checkout <branch>` – checking all repositories to given branch (or hash),
+* `mgit status` – displaying information about all repositories.
 
-If you are developing custom packages or forked any of the official packages and want mgit to work with it, change the dependencies configuration in [`mgit.json`](https://github.com/ckeditor/ckeditor5/blob/master/mgit.json). Note that mgit is able to clone the package from any Git URL. Refer to [its documentation](https://github.com/cksource/mgit2) for more details.
+Read more about those commands in [mgit's documentation](https://github.com/cksource/mgit2).
 
-### Troubleshooting problems with Lerna
+Mgit has been developed by the [CKSource team](https://cksource.com/) and we are relying on it heavily, hence you can expect more features and improvements to come. However, it is not a CKEditor-specific tool and should be suitable for any multi-repository project (though it best fits JavaScript projects).
 
-Lerna does pretty complicated things on an already complicated npm ecosystem. If you happen to run into some issues when calling `lerna bootstrap`, here are some tips:
-
-* Look for `npm-debug.log` files in the main package and subpackages. They may point to an obvious issue like a typo in some `package.json`.
-* Sometimes repeating `lerna bootstrap` may help.
-* If nothing else works, do `lerna clean && lerna bootstrap`.
-
-### Final word about mgit and Lerna
-
-Besides the already mentioned features, mgit allows you to [execute shell commands](https://github.com/cksource/mgit2#exec) on all packages (e.g. check their status). It has been developed by the [CKSource team](https://cksource.com/) and we are relying on it heavily, hence you can expect more features and improvements to come. However, it is not a CKEditor-specific tool and should be suitable for any multi-repository project (though it best fits JavaScript projects).
+### Using mgit for custom packages
 
-Lerna is a tool used by many well-known projects such as [Babel.js](https://github.com/babel/babel). It has an amazing community and, relying on it ourselves, we hope that it will become a standard for managing multi-package projects.
+If you are developing custom packages or forked any of the official packages and want mgit to work with it, change the dependencies configuration in [`mgit.json`](https://github.com/ckeditor/ckeditor5/blob/master/mgit.json). Note that mgit is able to clone the package from any Git URL. Refer to [its documentation](https://github.com/cksource/mgit2) for more details.
 
 ## Running tests
 
 In order to run tests you need to use the `test` and `manual` tasks.
 
 ```bash
-npm test -- --watch --coverage --source-map --files=engine
+yarn run test --watch --coverage --source-map --files=engine
 ```
 
 or, shorter:
 
 ```bash
-npm test -- -wcs --files=engine
+yarn run test -- -wcs --files=engine
 ```
 
 This command will run the [`ckeditor5-engine`](https://github.com/ckeditor/ckeditor5-engine) package's tests.
@@ -168,7 +184,7 @@ This command will run the [`ckeditor5-engine`](https://github.com/ckeditor/ckedi
 To create a server for manual tests use the `manual` task:
 
 ```bash
-npm run manual
+yarn run manual
 ```
 
 It accepts the `--source-map` (`-s`) option. Note that it watches for changes in the JavaScript files only (see the [bug](https://github.com/ckeditor/ckeditor5-dev/issues/52)).
@@ -180,24 +196,24 @@ You can read more about the {@link framework/guides/contributing/testing-environ
 To build the documentation you need to run the `docs` task:
 
 ```bash
-npm run docs
+yarn run docs
 ```
 
 The documentation will be available in `build/docs/`.
 
 This task accepts the following arguments:
 
-* `--skip-api` &ndash; Skips building the API documentation (which takes the majority of the total time).
-* `--skip-snippets` &ndash; Skips building live snippets.
-* `--skip-validation` &ndash; Skips the final link validation.
-* `--watch` &ndash; Runs the documentation generator in a watch mode. It covers guides (it does not cover API docs).
-* `--production` &ndash; Minifies the assets and performs other actions which are unnecessary during CKEditor 5 development.
-* `--verbose` &ndash; Prints out more information.
+* `--skip-api` &mdash; Skips building the API documentation (which takes the majority of the total time).
+* `--skip-snippets` &mdash; Skips building live snippets.
+* `--skip-validation` &mdash; Skips the final link validation.
+* `--watch` &mdash; Runs the documentation generator in a watch mode. It covers guides (it does not cover API docs).
+* `--production` &mdash; Minifies the assets and performs other actions which are unnecessary during CKEditor 5 development.
+* `--verbose` &mdash; Prints out more information.
 
 Note: These arguments must be passed after additional `--`:
 
 ```
-npm run docs -- --skip-api
+yarn run docs --skip-api
 ```
 
 ## Bisecting through a multi-repository

+ 5 - 5
docs/framework/guides/contributing/testing-environment.md

@@ -15,7 +15,7 @@ Each CKEditor package has its own tests suite (see for example the [engine's tes
 
 ## Running automated tests
 
-In order to run the automated tests use the `npm test [-- <args>...]` command.
+In order to run the automated tests use the `yarn run test [<args>...]` command.
 
 It accepts the following arguments (must be passed after the `--` option):
 
@@ -31,24 +31,24 @@ It accepts the following arguments (must be passed after the `--` option):
 Run all tests with the code coverage check of the [`ckeditor5-core`](https://github.com/ckeditor/ckeditor5-core) package:
 
 ```
-npm test -- -c --files=core
+yarn run test -c --files=core
 ```
 
 Run and watch the [engine's `view` namespace tests](https://github.com/ckeditor/ckeditor5-engine/tree/master/tests/view) and all the tests in [`ckeditor5-typing`](https://github.com/ckeditor/ckeditor5-typing):
 
 ```
-npm test -- -cw --files=engine/view,typing
+yarn run test -cw --files=engine/view,typing
 ```
 
 Run the `bold*.js` tests in the [`ckeditor5-basic-styles`](https://github.com/ckeditor/ckeditor5-basic-styles) package:
 
 ```
-npm test -- -cw --files=basic-styles/bold*.js
+yarn run test -cw --files=basic-styles/bold*.js
 ```
 
 ## Running manual tests
 
-In order to start the manual tests server use the `npm run manual` task.
+In order to start the manual tests server use the `yarn run manual` task.
 
 The task accepts the `--source-map` (alias `-s`) option.
 

+ 1 - 1
docs/framework/guides/quick-start.md

@@ -161,7 +161,7 @@ You can now run webpack to build the application. To do that, call the `webpack`
 	And use it via:
 
 	```bash
-	npm run build
+	yarn run build
 	```
 
 	npm adds `./node_modules/.bin/` to the `PATH` automatically, so in this case you do not need to install `webpack-cli` globally.

+ 0 - 14
lerna.json

@@ -1,14 +0,0 @@
-{
-  "lerna": "2.0.0-rc.1",
-  "packages": [
-    "packages/*",
-    "."
-  ],
-  "hoist": true,
-  "nohoist": "husky",
-  "commands": {
-    "bootstrap": {
-      "concurrency": 1
-    }
-  }
-}

+ 12 - 8
package.json

@@ -66,18 +66,17 @@
     "@ckeditor/ckeditor5-real-time-collaboration": "^12.0.1",
     "@ckeditor/ckeditor5-comments": "^1.0.1",
     "@ckeditor/ckeditor5-dev-docs": "^10.0.3",
-    "@ckeditor/ckeditor5-dev-env": "^13.0.1",
-    "@ckeditor/ckeditor5-dev-tests": "^13.1.2",
-    "@ckeditor/ckeditor5-dev-utils": "^11.0.0",
-    "@ckeditor/ckeditor5-dev-webpack-plugin": "^7.0.0",
+    "@ckeditor/ckeditor5-dev-env": "^13.0.2",
+    "@ckeditor/ckeditor5-dev-tests": "^15.0.1",
+    "@ckeditor/ckeditor5-dev-utils": "^11.0.1",
+    "@ckeditor/ckeditor5-dev-webpack-plugin": "^7.0.1",
     "css-loader": "^1.0.0",
     "eslint": "^5.5.0",
     "eslint-config-ckeditor5": "^1.0.9",
     "glob": "^7.1.2",
     "husky": "^0.14.3",
-    "lerna": "^2.2.0",
     "lint-staged": "^7.0.0",
-    "mgit2": "^0.8.0",
+    "mgit2": "^0.10.0",
     "mini-css-extract-plugin": "^0.4.0",
     "minimatch": "^3.0.4",
     "postcss-loader": "^3.0.0",
@@ -105,8 +104,10 @@
     "precommit": "lint-staged",
     "test": "node --max_old_space_size=4096 node_modules/@ckeditor/ckeditor5-dev-tests/bin/test.js",
     "manual": "node --max_old_space_size=4096 node_modules/@ckeditor/ckeditor5-dev-tests/bin/test-manual.js",
-    "reset": "rm -rf ./packages ./node_modules && mgit bootstrap && lerna bootstrap",
-    "reinstall": "lerna clean --yes && lerna bootstrap",
+    "bootstrap": "mgit sync && yarn install",
+    "clean": "rm -rf node_modules && mgit exec 'rm -rf node_modules'",
+    "reset": "rm -rf ./packages ./node_modules && yarn run bootstrap",
+    "reinstall": "yarn run clean && yarn run bootstrap",
     "docs": "node ./scripts/docs/build-docs.js",
     "docs:api": "node ./scripts/docs/build-api-docs.js",
     "docs:build-and-publish": "node ./scripts/docs/build-and-publish.js",
@@ -130,5 +131,8 @@
     "build/**",
     "coverage/**",
     "packages/**"
+  ],
+  "workspaces": [
+    "packages/*"
   ]
 }

+ 2 - 2
scripts/bump-year.js

@@ -14,10 +14,10 @@ mgit exec 'node ../../scripts/bump-year.js'
 node scripts/bump-year.js
 
 Full command to update the entire project:
-git pull && mgit update && mgit exec 'node ../../scripts/bump-year.js' && node scripts/bump-year.js
+git pull && mgit sync && mgit exec 'node ../../scripts/bump-year.js' && node scripts/bump-year.js
 
 And after reviewing the changes:
-mgit exec 'git commit -am "Internal: Bumped the year. [skip ci]" && git push' && git commit -am "Internal: Bumped the year." && git push
+mgit commit -m "Internal: Bumped the year. [skip ci]" && mgit push git commit -am "Internal: Bumped the year." && git push
 
 */
 

+ 27 - 2
scripts/docs/build-and-publish-nightly.js

@@ -26,6 +26,7 @@ if ( process.env.TRAVIS_EVENT_TYPE !== 'cron' ) {
 }
 
 const path = require( 'path' );
+const ROOT_PATH = process.cwd();
 const { tools } = require( '@ckeditor/ckeditor5-dev-utils' );
 
 const mainRepoUrl = 'https://github.com/CKEditor5/ckeditor5.github.io';
@@ -39,7 +40,7 @@ exec( `git clone ${ mainRepoUrl }.git` );
 
 // Build the documentation.
 console.log( 'Building documentation...' );
-exec( 'npm run docs -- --production' );
+exec( 'yarn run docs --production' );
 
 console.log( 'Copying files...' );
 
@@ -58,7 +59,7 @@ exec( 'rm -rf ckeditor5.github.io/docs/nightly/ckeditor5/latest' );
 exec( `cp -R ckeditor5.github.io/docs/nightly/ckeditor5/${ projectVersion } ckeditor5.github.io/docs/nightly/ckeditor5/latest` );
 
 // Change work directory in order to make a commit in CKEditor 5 page's repository.
-process.chdir( path.join( process.cwd(), 'ckeditor5.github.io' ) );
+process.chdir( path.join( ROOT_PATH, 'ckeditor5.github.io' ) );
 
 exec( `echo "https://${ process.env.GITHUB_TOKEN }:@github.com" > .git/credentials 2> /dev/null` );
 exec( 'git config credential.helper "store --file=.git/credentials"' );
@@ -75,6 +76,30 @@ if ( exec( 'git diff --name-only docs/' ).trim().length ) {
 	console.log( 'Nothing to commit. Documentation is up to date.' );
 }
 
+// Every 10th day of the month, we would like to clean the history of the documentation repository.
+if ( new Date().getDate() === 10 ) {
+	// Copy a commit which will be a new root in the repository.
+	const commit = exec( 'git log --oneline --reverse -5 --format="%h" | head -n 1' ).trim();
+
+	// Checkout to the status of the git repo at commit. Create a temporary branch.
+	exec( `git checkout --orphan temp ${ commit }` );
+
+	// Create a new commit that is to be the new root commit.
+	exec( 'git commit -m "Documentation build."' );
+
+	// Rebase the part of history from <commit> to master on the temporary branch.
+	exec( `git rebase --onto temp ${ commit } master` );
+
+	// Remove the temporary branch.
+	exec( 'git branch -D temp' );
+
+	// Pray.
+	exec( 'git push -f' );
+}
+
+// Change work directory to the previous value.
+process.chdir( ROOT_PATH );
+
 function exec( command ) {
 	try {
 		return tools.shExec( command, { verbosity: 'error' } );

+ 1 - 1
scripts/docs/build-and-publish.js

@@ -29,7 +29,7 @@ console.log( 'Updating your ckeditor5.github.io clone...' );
 exec( 'cd ../ckeditor5.github.io && git pull && cd -' );
 
 console.log( 'Building documentation...' );
-exec( 'npm run docs -- --production' );
+exec( 'yarn run docs --production' );
 
 console.log( 'Copying files...' );
 

+ 2 - 2
scripts/release/bump-versions.js

@@ -18,10 +18,10 @@
 // You can test the whole process using `dry-run` mode. It won't change anything in the project
 // and any repository.
 //
-// This task must be called before: `npm run release:publish`.
+// This task must be called before: `yarn run release:publish`.
 //
 // Use:
-// npm run release:bump-version -- --dry-run
+// yarn run release:bump-version --dry-run
 
 require( '@ckeditor/ckeditor5-dev-env' )
 	.bumpVersions( {

+ 1 - 1
scripts/release/changelog.js

@@ -10,7 +10,7 @@
 'use strict';
 
 // In order to use the same version for all packages (including builds and ckeditor5 itself), you can call:
-// npm run changelog [newVersion]
+// yarn run changelog [newVersion]
 
 const devEnv = require( '@ckeditor/ckeditor5-dev-env' );
 const commonOptions = {

+ 2 - 2
scripts/release/publish.js

@@ -16,10 +16,10 @@
 //
 // Note: This task based on versions published on NPM and GitHub. If something went wrong, you can call this script one more time.
 //
-// This task should be executed after: `npm run release:bump-version`.
+// This task should be executed after: `yarn run release:bump-version`.
 //
 // Use:
-// npm run release:publish -- --dry-run
+// yarn run release:publish --dry-run
 
 /* eslint-disable max-len */
 

文件差异内容过多而无法显示
+ 10777 - 0
yarn.lock