8
0
Quellcode durchsuchen

Enhancement: Remove gulp and use npm scripts for release tasks.

Maciej Gołaszewski vor 8 Jahren
Ursprung
Commit
bc6c68661d

+ 1 - 1
.travis.yml

@@ -15,7 +15,7 @@ before_install:
   - export DISPLAY=:99.0
   - sh -e /etc/init.d/xvfb start
 install:
-  - npm install mgit2 lerna gulp @ckeditor/ckeditor5-dev-tests @ckeditor/ckeditor5-dev-docs
+  - npm install mgit2 lerna @ckeditor/ckeditor5-dev-tests @ckeditor/ckeditor5-dev-docs
   - mgit bootstrap --resolver-url-template="https://github.com/\${ path }.git"
   - lerna bootstrap
 script:

+ 5 - 6
docs/framework/guides/contributing/development-environment.md

@@ -27,14 +27,13 @@ In order to start developing CKEditor 5 you will require:
 
 First, you need to install a couple of tools which you will be using later:
 
-* [gulp](http://gulpjs.com/) (a JavaScript task runner),
 * [mgit](https://www.npmjs.com/package/mgit2) (a multi-repo management tool),
 * [Lerna.js](https://github.com/lerna/lerna) (a multi-package management tool).
 
 It is best to install them globally in your system for an easier use later on:
 
 ```bash
-npm install -g gulp lerna mgit2
+npm install -g lerna mgit2
 ```
 
 Note: You may need to use `sudo` on Linux and macOS.
@@ -153,13 +152,13 @@ Lerna is a tool used by many well-known projects such as [Babel.js](https://gith
 In order to run tests you need to use the `test` and `test:manual` tasks.
 
 ```bash
-gulp test --watch --coverage --source-map --files=engine
+npm test -- --watch --coverage --source-map --files=engine
 ```
 
 or, shorter:
 
 ```bash
-gulp test -wcs --files=engine
+npm test -- -wcs --files=engine
 ```
 
 This command will run the [`ckeditor5-engine`](https://github.com/ckeditor/ckeditor5-engine) package's tests.
@@ -169,7 +168,7 @@ This command will run the [`ckeditor5-engine`](https://github.com/ckeditor/ckedi
 To create a server for manual tests use the `test:manual` task:
 
 ```bash
-gulp test:manual
+npm run test:manual
 ```
 
 It accepts the `--source-map` (`-s`) option. Note that it watches for changes only in the JavaScript files (see the [bug](https://github.com/ckeditor/ckeditor5-dev/issues/52)).
@@ -187,7 +186,7 @@ npm run install-optional-dependencies
 Then you can run the `docs` task:
 
 ```bash
-gulp docs
+npm run docs
 ```
 
 The documentation will be available in `build/docs/`.

+ 7 - 11
docs/framework/guides/contributing/testing-environment.md

@@ -9,19 +9,15 @@ Before reading this article we recommend getting familiar with the CKEditor 5 {@
 
 ## Introduction
 
-The CKEditor 5 testing environment uses a popular setup with [Karma](https://karma-runner.github.io), [webpack](https://webpack.github.io/), [babel-loader](https://github.com/babel/babel-loader) and [Istanbul](https://github.com/gotwarlost/istanbul). We created some [gulp](https://github.com/gulpjs/gulp) tasks which glue all these pieces and special requirements for CKEditor together.
-
-<info-box>
-	We are [considering dropping gulp and switching to npm scripts](https://github.com/ckeditor/ckeditor5/issues/473), so please do not be surprised that both methods are in use now.
-</info-box>
+The CKEditor 5 testing environment uses a popular setup with [Karma](https://karma-runner.github.io), [webpack](https://webpack.github.io/), [babel-loader](https://github.com/babel/babel-loader) and [Istanbul](https://github.com/gotwarlost/istanbul). We created some [npm scripts](https://docs.npmjs.com/cli/run-script) which glue all these pieces and special requirements for CKEditor together.
 
 Each CKEditor package has its own tests suite (see for example the [engine's tests](https://github.com/ckeditor/ckeditor5-engine/tree/master/tests)), however, the test runner is available in the [`ckeditor5`](https://github.com/ckeditor/ckeditor5) package which is the central development environment. The actual code of the test runner is implemented in the [`@ckeditor/ckeditor5-dev-tests`](https://www.npmjs.com/package/@ckeditor/ckeditor5-dev-tests) package and can be easily reused outside of `ckeditor5`.
 
 ## Running automated tests
 
-In order to run the automated tests use the `gulp test` task.
+In order to run the automated tests use the `npm test [-- <args>...]` command.
 
-It accepts the following arguments:
+It accepts the following arguments (must be passed after the `--` option):
 
 * `--watch` (alias `-w`) &ndash; Whether to watch the files and execute tests whenever any file changes.
 * `--source-map` (alias `-s`) &ndash; Whether to generate the source maps.
@@ -35,24 +31,24 @@ It accepts the following arguments:
 Run all tests with the code coverage check of the [`ckeditor5-core`](https://github.com/ckeditor/ckeditor5-core) package:
 
 ```
-gulp test -c --files=core
+npm 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):
 
 ```
-gulp test -cw --files=engine/view,typing
+npm test -- -cw --files=engine/view,typing
 ```
 
 Run the `bold*.js` tests in the [`ckeditor5-basic-styles`](https://github.com/ckeditor/ckeditor5-basic-styles) package:
 
 ```
-gulp test -cw --files=basic-styles/bold*.js
+npm test -- -cw --files=basic-styles/bold*.js
 ```
 
 ## Running manual tests
 
-In order to start the manual tests server use the `gulp test:manual` task.
+In order to start the manual tests server use the `npm run test:manual` task.
 
 The task accepts the `--source-map` (alias `-s`) option.
 

+ 0 - 34
gulpfile.js

@@ -1,34 +0,0 @@
-/**
- * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.
- * For licensing, see LICENSE.md.
- */
-
-/* eslint-env node */
-
-'use strict';
-
-const gulp = require( 'gulp' );
-
-const assertIsInstalled = require( './scripts/util/assertisinstalled' );
-
-// Releasing. -----------------------------------------------------------------
-
-gulp.task( 'changelog:dependencies', () => {
-	assertIsInstalled( '@ckeditor/ckeditor5-dev-env' );
-
-	return require( '@ckeditor/ckeditor5-dev-env' )
-		.generateChangelogForSubRepositories( {
-			cwd: process.cwd(),
-			packages: 'packages'
-		} );
-} );
-
-gulp.task( 'release:dependencies', () => {
-	assertIsInstalled( '@ckeditor/ckeditor5-dev-env' );
-
-	return require( '@ckeditor/ckeditor5-dev-env' )
-		.releaseSubRepositories( {
-			cwd: process.cwd(),
-			packages: 'packages'
-		} );
-} );

+ 2 - 1
package.json

@@ -48,7 +48,6 @@
     "@ckeditor/ckeditor5-dev-tests": "^8.2.2",
     "eslint": "^4.8.0",
     "eslint-config-ckeditor5": "^1.0.6",
-    "gulp": "^3.9.1",
     "husky": "^0.14.3",
     "lint-staged": "^4.2.3",
     "lerna": "^2.2.0",
@@ -76,6 +75,8 @@
     "translations:collect": "ckeditor5-dev-env-translations collect",
     "translations:download": "ckeditor5-dev-env-translations download",
     "translations:upload": "ckeditor5-dev-env-translations upload",
+    "changelog:dependencies": "./scripts/release/changelog-dependencies.js",
+    "release:dependencies": "./scripts/release/release-dependencies.js",
     "install-optional-dependencies": "./scripts/install-optional-dependencies.sh",
     "switch-to-dev-dev": "./scripts/switch-to-dev-dev.sh",
     "build-and-publish-docs": "./scripts/docs/build-and-publish.js"

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

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

+ 4 - 4
scripts/install-optional-dependencies.sh

@@ -6,10 +6,10 @@
 # Installs optional dev dependencies.
 # They are required by the following tasks:
 #
-# * gulp docs
-# * gulp changelog:dependencies
-# * gulp release:dependencies
-# * gulp translations:*
+# * npm run docs
+# * npm run changelog:dependencies
+# * npm run release:dependencies
+# * npm run translations:*
 
 set -e
 

+ 20 - 0
scripts/release/changelog-dependencies.js

@@ -0,0 +1,20 @@
+#!/usr/bin/env node
+
+/**
+ * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.
+ * For licensing, see LICENSE.md.
+ */
+
+/* eslint-env node */
+
+'use strict';
+
+const assertIsInstalled = require( './../util/assertisinstalled' );
+
+assertIsInstalled( '@ckeditor/ckeditor5-dev-env' );
+
+require( '@ckeditor/ckeditor5-dev-env' )
+	.generateChangelogForSubRepositories( {
+		cwd: process.cwd(),
+		packages: 'packages'
+	} );

+ 20 - 0
scripts/release/release-dependencies.js

@@ -0,0 +1,20 @@
+#!/usr/bin/env node
+
+/**
+ * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.
+ * For licensing, see LICENSE.md.
+ */
+
+/* eslint-env node */
+
+'use strict';
+
+const assertIsInstalled = require( './../util/assertisinstalled' );
+
+assertIsInstalled( '@ckeditor/ckeditor5-dev-env' );
+
+require( '@ckeditor/ckeditor5-dev-env' )
+	.releaseSubRepositories( {
+		cwd: process.cwd(),
+		packages: 'packages'
+	} );