From e816cbb77a10205f1ef17928efa8a5272b4eca3a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Maciej=20Go=C5=82aszewski?= Date: Wed, 11 Oct 2017 14:16:17 +0200 Subject: [PATCH 01/12] Enhancement: Use npm scripts for tests. --- .../contributing/development-environment.md | 2 +- gulpfile.js | 17 ----------------- package.json | 3 ++- 3 files changed, 3 insertions(+), 19 deletions(-) diff --git a/docs/framework/guides/contributing/development-environment.md b/docs/framework/guides/contributing/development-environment.md index 0e0cc486de2..66e0080ddbc 100644 --- a/docs/framework/guides/contributing/development-environment.md +++ b/docs/framework/guides/contributing/development-environment.md @@ -103,7 +103,7 @@ lrwxr-xr-x 1 p staff 25 31 Jan 10:37 ckeditor5-engine -> ../../../ckedito If everything worked correctly, you should be able to run some tests: ```bash -gulp test --files=core +npm run test -- --files=core ``` ### Fetching changes diff --git a/gulpfile.js b/gulpfile.js index e8e503ee218..d2b7b997cb6 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -10,23 +10,6 @@ const path = require( 'path' ); const gulp = require( 'gulp' ); -// Tests. --------------------------------------------------------------------- - -gulp.task( 'test', () => { - return require( '@ckeditor/ckeditor5-dev-tests' ) - .runAutomatedTests( getTestOptions() ); -} ); - -gulp.task( 'test:manual', () => { - return require( '@ckeditor/ckeditor5-dev-tests' ) - .runManualTests( getTestOptions() ); -} ); - -function getTestOptions() { - return require( '@ckeditor/ckeditor5-dev-tests' ) - .parseArguments( process.argv.slice( 2 ) ); -} - // Documentation. ------------------------------------------------------------- gulp.task( 'docs', () => { diff --git a/package.json b/package.json index 0ba22c864b6..07514dfcd1a 100644 --- a/package.json +++ b/package.json @@ -69,7 +69,8 @@ "scripts": { "lint": "eslint --quiet '**/*.js'", "precommit": "lint-staged", - "test": "node --max_old_space_size=4096 ./node_modules/.bin/ckeditor5-dev-tests --reporter=dots", + "test": "node --max_old_space_size=4096 ./node_modules/.bin/ckeditor5-dev-tests", + "test:manual": "node --max_old_space_size=4096 ./node_modules/.bin/ckeditor5-dev-tests-manual", "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" From 78a9995e2386f0f402954a5ed606e337d553de26 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Maciej=20Go=C5=82aszewski?= Date: Wed, 11 Oct 2017 14:46:40 +0200 Subject: [PATCH 02/12] Enhancement: Use npm scripts for building documentation. --- gulpfile.js | 82 +------------------------------ package.json | 2 + scripts/docs/build-api-docs.js | 14 ++++++ scripts/docs/build-docs.js | 57 +++++++++++++++++++++ scripts/docs/buildapi.js | 29 +++++++++++ scripts/util/assertisinstalled.js | 20 ++++++++ 6 files changed, 123 insertions(+), 81 deletions(-) create mode 100755 scripts/docs/build-api-docs.js create mode 100755 scripts/docs/build-docs.js create mode 100644 scripts/docs/buildapi.js create mode 100644 scripts/util/assertisinstalled.js diff --git a/gulpfile.js b/gulpfile.js index d2b7b997cb6..ee0820e0c7f 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -7,75 +7,9 @@ 'use strict'; -const path = require( 'path' ); const gulp = require( 'gulp' ); -// Documentation. ------------------------------------------------------------- - -gulp.task( 'docs', () => { - const skipLiveSnippets = process.argv.includes( '--skip-snippets' ); - const skipApi = process.argv.includes( '--skip-api' ); - const production = process.argv.includes( '--production' ); - - if ( skipApi ) { - const fs = require( 'fs' ); - const apiJsonPath = './docs/api/output.json'; - - if ( fs.existsSync( apiJsonPath ) ) { - fs.unlinkSync( apiJsonPath ); - } - - return runUmberto( { - skipLiveSnippets, - skipApi, - production - } ); - } - - // Simple way to reuse existing api/output.json: - // return Promise.resolve() - return buildApiDocs() - .then( () => { - return runUmberto( { - skipLiveSnippets, - production - } ); - } ); -} ); - -gulp.task( 'docs:api', buildApiDocs ); - -function buildApiDocs() { - assertIsInstalled( '@ckeditor/ckeditor5-dev-docs' ); - - const ckeditor5Docs = require( '@ckeditor/ckeditor5-dev-docs' ); - - return ckeditor5Docs - .build( { - readmePath: path.join( process.cwd(), 'README.md' ), - sourceFiles: [ - process.cwd() + '/packages/ckeditor5-*/src/**/*.@(js|jsdoc)', - '!' + process.cwd() + '/packages/ckeditor5-*/src/lib/**/*.js', - '!' + process.cwd() + '/packages/ckeditor5-build-*/src/**/*.js' - ], - validateOnly: process.argv[ 3 ] == '--validate-only' - } ); -} - -function runUmberto( options ) { - assertIsInstalled( 'umberto' ); - const umberto = require( 'umberto' ); - - return umberto.buildSingleProject( { - configDir: 'docs', - clean: true, - skipLiveSnippets: options.skipLiveSnippets, - snippetOptions: { - production: options.production - }, - skipApi: options.skipApi - } ); -} +const assertIsInstalled = require( './scripts/util/assertisinstalled' ); // Translations. -------------------------------------------------------------- @@ -118,17 +52,3 @@ gulp.task( 'release:dependencies', () => { packages: 'packages' } ); } ); - -// Utils. --------------------------------------------------------------------- - -function assertIsInstalled( packageName ) { - try { - require( packageName + '/package.json' ); - } catch ( err ) { - console.error( `Error: Cannot find package '${ packageName }'.\n` ); - console.error( 'You need to install optional dependencies.' ); - console.error( 'Run: \'npm run install-optional-dependencies\'.' ); - - process.exit( 1 ); - } -} diff --git a/package.json b/package.json index 07514dfcd1a..4d1fc4b3568 100644 --- a/package.json +++ b/package.json @@ -71,6 +71,8 @@ "precommit": "lint-staged", "test": "node --max_old_space_size=4096 ./node_modules/.bin/ckeditor5-dev-tests", "test:manual": "node --max_old_space_size=4096 ./node_modules/.bin/ckeditor5-dev-tests-manual", + "docs": "./scripts/docs/build-docs.js", + "docs:api": "./scripts/docs/build-api-docs.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" diff --git a/scripts/docs/build-api-docs.js b/scripts/docs/build-api-docs.js new file mode 100755 index 00000000000..9a73c890075 --- /dev/null +++ b/scripts/docs/build-api-docs.js @@ -0,0 +1,14 @@ +#!/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 buildApiDocs = require( './buildapi' ); + +buildApiDocs(); diff --git a/scripts/docs/build-docs.js b/scripts/docs/build-docs.js new file mode 100755 index 00000000000..5a89bacbeee --- /dev/null +++ b/scripts/docs/build-docs.js @@ -0,0 +1,57 @@ +#!/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' ); +const buildApiDocs = require( './buildapi' ); + +const skipLiveSnippets = process.argv.includes( '--skip-snippets' ); +const skipApi = process.argv.includes( '--skip-api' ); +const production = process.argv.includes( '--production' ); + +if ( skipApi ) { + const fs = require( 'fs' ); + const apiJsonPath = './docs/api/output.json'; + + if ( fs.existsSync( apiJsonPath ) ) { + fs.unlinkSync( apiJsonPath ); + } + + runUmberto( { + skipLiveSnippets, + skipApi, + production + } ).then( () => process.exit() ); +} + +// Simple way to reuse existing api/output.json: +// return Promise.resolve() +buildApiDocs() + .then( () => { + return runUmberto( { + skipLiveSnippets, + production + } ); + } ); + +function runUmberto( options ) { + assertIsInstalled( 'umberto' ); + const umberto = require( 'umberto' ); + + return umberto.buildSingleProject( { + configDir: 'docs', + clean: true, + skipLiveSnippets: options.skipLiveSnippets, + snippetOptions: { + production: options.production + }, + skipApi: options.skipApi + } ); +} diff --git a/scripts/docs/buildapi.js b/scripts/docs/buildapi.js new file mode 100644 index 00000000000..3b45d4c24a9 --- /dev/null +++ b/scripts/docs/buildapi.js @@ -0,0 +1,29 @@ +/** + * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved. + * For licensing, see LICENSE.md. + */ + +/* eslint-env node */ + +'use strict'; + +const path = require( 'path' ); + +const assertIsInstalled = require( './../util/assertisinstalled' ); + +module.exports = function buildApiDocs() { + assertIsInstalled( '@ckeditor/ckeditor5-dev-docs' ); + + const ckeditor5Docs = require( '@ckeditor/ckeditor5-dev-docs' ); + + return ckeditor5Docs + .build( { + readmePath: path.join( process.cwd(), 'README.md' ), + sourceFiles: [ + process.cwd() + '/packages/ckeditor5-*/src/**/*.@(js|jsdoc)', + '!' + process.cwd() + '/packages/ckeditor5-*/src/lib/**/*.js', + '!' + process.cwd() + '/packages/ckeditor5-build-*/src/**/*.js' + ], + validateOnly: process.argv[ 3 ] == '--validate-only' + } ); +}; diff --git a/scripts/util/assertisinstalled.js b/scripts/util/assertisinstalled.js new file mode 100644 index 00000000000..989f62cd2f4 --- /dev/null +++ b/scripts/util/assertisinstalled.js @@ -0,0 +1,20 @@ +/** + * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved. + * For licensing, see LICENSE.md. + */ + +/* eslint-env node */ + +'use strict'; + +module.exports = function assertIsInstalled( packageName ) { + try { + require( packageName + '/package.json' ); + } catch ( err ) { + console.error( `Error: Cannot find package '${ packageName }'.\n` ); + console.error( 'You need to install optional dependencies.' ); + console.error( 'Run: \'npm run install-optional-dependencies\'.' ); + + process.exit( 1 ); + } +}; From 07dbcd2e1868d5eff00b2b5cc7255c909805418f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Maciej=20Go=C5=82aszewski?= Date: Wed, 11 Oct 2017 14:58:11 +0200 Subject: [PATCH 03/12] Other: Update Travis configuration for tests and docs checking. --- .travis.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index d51bdd6e359..aebb3c7049e 100644 --- a/.travis.yml +++ b/.travis.yml @@ -19,8 +19,8 @@ install: - mgit bootstrap --resolver-url-template="https://github.com/\${ path }.git" - lerna bootstrap script: - - npm t - - gulp docs:api --validate-only + - npm t -- --reporter=dots + - npm run docs:api -- --validate-only after_success: - ./node_modules/.bin/ckeditor5-dev-docs-publish-nightly notifications: From afa27c62d36ec521bbeb621715bdc2d289265b2e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Maciej=20Go=C5=82aszewski?= Date: Thu, 12 Oct 2017 13:39:13 +0200 Subject: [PATCH 04/12] Enhancement: Use npm scripts for translations tasks. --- gulpfile.js | 20 -------------------- package.json | 3 +++ 2 files changed, 3 insertions(+), 20 deletions(-) diff --git a/gulpfile.js b/gulpfile.js index ee0820e0c7f..472706a171c 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -11,26 +11,6 @@ const gulp = require( 'gulp' ); const assertIsInstalled = require( './scripts/util/assertisinstalled' ); -// Translations. -------------------------------------------------------------- - -gulp.task( 'translations:collect', () => { - assertIsInstalled( '@ckeditor/ckeditor5-dev-env' ); - - return require( '@ckeditor/ckeditor5-dev-env' ).collectTranslations(); -} ); - -gulp.task( 'translations:upload', () => { - assertIsInstalled( '@ckeditor/ckeditor5-dev-env' ); - - return require( '@ckeditor/ckeditor5-dev-env' ).uploadTranslations(); -} ); - -gulp.task( 'translations:download', () => { - assertIsInstalled( '@ckeditor/ckeditor5-dev-env' ); - - return require( '@ckeditor/ckeditor5-dev-env' ).downloadTranslations(); -} ); - // Releasing. ----------------------------------------------------------------- gulp.task( 'changelog:dependencies', () => { diff --git a/package.json b/package.json index 4d1fc4b3568..a268b5cfca3 100644 --- a/package.json +++ b/package.json @@ -73,6 +73,9 @@ "test:manual": "node --max_old_space_size=4096 ./node_modules/.bin/ckeditor5-dev-tests-manual", "docs": "./scripts/docs/build-docs.js", "docs:api": "./scripts/docs/build-api-docs.js", + "translations:collect": "ckeditor5-dev-env-translations collect", + "translations:download": "ckeditor5-dev-env-translations download", + "translations:upload": "ckeditor5-dev-env-translations upload", "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" From bc6c68661daf0d1b68e3f6c518d69d1e48f790fd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Maciej=20Go=C5=82aszewski?= Date: Thu, 12 Oct 2017 16:00:58 +0200 Subject: [PATCH 05/12] Enhancement: Remove gulp and use npm scripts for release tasks. --- .travis.yml | 2 +- .../contributing/development-environment.md | 11 +++--- .../contributing/testing-environment.md | 18 ++++------ gulpfile.js | 34 ------------------- package.json | 3 +- scripts/docs/build-and-publish.js | 2 +- scripts/install-optional-dependencies.sh | 8 ++--- scripts/release/changelog-dependencies.js | 20 +++++++++++ scripts/release/release-dependencies.js | 20 +++++++++++ 9 files changed, 60 insertions(+), 58 deletions(-) delete mode 100644 gulpfile.js create mode 100755 scripts/release/changelog-dependencies.js create mode 100755 scripts/release/release-dependencies.js diff --git a/.travis.yml b/.travis.yml index aebb3c7049e..a177e398153 100644 --- a/.travis.yml +++ b/.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: diff --git a/docs/framework/guides/contributing/development-environment.md b/docs/framework/guides/contributing/development-environment.md index 66e0080ddbc..11cb4538681 100644 --- a/docs/framework/guides/contributing/development-environment.md +++ b/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/`. diff --git a/docs/framework/guides/contributing/testing-environment.md b/docs/framework/guides/contributing/testing-environment.md index 3811d5c5252..28811a2b0cb 100644 --- a/docs/framework/guides/contributing/testing-environment.md +++ b/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. - - - 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. - +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 [-- ...]` command. -It accepts the following arguments: +It accepts the following arguments (must be passed after the `--` option): * `--watch` (alias `-w`) – Whether to watch the files and execute tests whenever any file changes. * `--source-map` (alias `-s`) – 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. diff --git a/gulpfile.js b/gulpfile.js deleted file mode 100644 index 472706a171c..00000000000 --- a/gulpfile.js +++ /dev/null @@ -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' - } ); -} ); diff --git a/package.json b/package.json index a268b5cfca3..a0d1f667f95 100644 --- a/package.json +++ b/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" diff --git a/scripts/docs/build-and-publish.js b/scripts/docs/build-and-publish.js index 9a2cbbc7495..014759315ea 100755 --- a/scripts/docs/build-and-publish.js +++ b/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...' ); diff --git a/scripts/install-optional-dependencies.sh b/scripts/install-optional-dependencies.sh index 90e3c238935..e75fbddc09b 100755 --- a/scripts/install-optional-dependencies.sh +++ b/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 diff --git a/scripts/release/changelog-dependencies.js b/scripts/release/changelog-dependencies.js new file mode 100755 index 00000000000..f6b4631b19a --- /dev/null +++ b/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' + } ); diff --git a/scripts/release/release-dependencies.js b/scripts/release/release-dependencies.js new file mode 100755 index 00000000000..717f04b2095 --- /dev/null +++ b/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' + } ); From b2b59917faeb3074eacdf4b96f58a05da5ded193 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Maciej=20Go=C5=82aszewski?= Date: Fri, 13 Oct 2017 08:16:45 +0200 Subject: [PATCH 06/12] Fix: NPM script docs ignores --skip-api option. --- scripts/docs/build-docs.js | 42 ++++++++++++++++++++++---------------- 1 file changed, 24 insertions(+), 18 deletions(-) diff --git a/scripts/docs/build-docs.js b/scripts/docs/build-docs.js index 5a89bacbeee..632bc1795ce 100755 --- a/scripts/docs/build-docs.js +++ b/scripts/docs/build-docs.js @@ -16,30 +16,36 @@ const skipLiveSnippets = process.argv.includes( '--skip-snippets' ); const skipApi = process.argv.includes( '--skip-api' ); const production = process.argv.includes( '--production' ); -if ( skipApi ) { - const fs = require( 'fs' ); - const apiJsonPath = './docs/api/output.json'; +buildDocs(); - if ( fs.existsSync( apiJsonPath ) ) { - fs.unlinkSync( apiJsonPath ); - } +function buildDocs() { + if ( skipApi ) { + const fs = require( 'fs' ); + const apiJsonPath = './docs/api/output.json'; - runUmberto( { - skipLiveSnippets, - skipApi, - production - } ).then( () => process.exit() ); -} + if ( fs.existsSync( apiJsonPath ) ) { + fs.unlinkSync( apiJsonPath ); + } -// Simple way to reuse existing api/output.json: -// return Promise.resolve() -buildApiDocs() - .then( () => { - return runUmberto( { + runUmberto( { skipLiveSnippets, + skipApi, production + } ).then( () => process.exit() ); + + return; + } + + // Simple way to reuse existing api/output.json: + // return Promise.resolve() + buildApiDocs() + .then( () => { + return runUmberto( { + skipLiveSnippets, + production + } ); } ); - } ); +} function runUmberto( options ) { assertIsInstalled( 'umberto' ); From f8197f09c562b368f1077037939e65c8ce03bbbf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Maciej=20Go=C5=82aszewski?= Date: Fri, 13 Oct 2017 08:18:02 +0200 Subject: [PATCH 07/12] Other: Add program runner for npm scripts for Windows compatibility. --- package.json | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/package.json b/package.json index a0d1f667f95..54c564f0ba4 100644 --- a/package.json +++ b/package.json @@ -70,16 +70,16 @@ "precommit": "lint-staged", "test": "node --max_old_space_size=4096 ./node_modules/.bin/ckeditor5-dev-tests", "test:manual": "node --max_old_space_size=4096 ./node_modules/.bin/ckeditor5-dev-tests-manual", - "docs": "./scripts/docs/build-docs.js", - "docs:api": "./scripts/docs/build-api-docs.js", + "docs": "node ./scripts/docs/build-docs.js", + "docs:api": "node ./scripts/docs/build-api-docs.js", "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" + "changelog:dependencies": "node ./scripts/release/changelog-dependencies.js", + "release:dependencies": "node ./scripts/release/release-dependencies.js", + "install-optional-dependencies": "sh ./scripts/install-optional-dependencies.sh", + "switch-to-dev-dev": "sh ./scripts/switch-to-dev-dev.sh", + "build-and-publish-docs": "node ./scripts/docs/build-and-publish.js" }, "lint-staged": { "**/*.js": [ From f9d1cc533ffe7a0ce0c89d1a473ebd887a77e99b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Maciej=20Go=C5=82aszewski?= Date: Fri, 13 Oct 2017 14:57:50 +0200 Subject: [PATCH 08/12] Internal: Rename scripts/util to scripts/utils. --- scripts/docs/build-docs.js | 2 +- scripts/docs/buildapi.js | 2 +- scripts/{util => utils}/assertisinstalled.js | 0 3 files changed, 2 insertions(+), 2 deletions(-) rename scripts/{util => utils}/assertisinstalled.js (100%) diff --git a/scripts/docs/build-docs.js b/scripts/docs/build-docs.js index 632bc1795ce..bf70727e88c 100755 --- a/scripts/docs/build-docs.js +++ b/scripts/docs/build-docs.js @@ -9,7 +9,7 @@ 'use strict'; -const assertIsInstalled = require( './../util/assertisinstalled' ); +const assertIsInstalled = require( './../utils/assertisinstalled' ); const buildApiDocs = require( './buildapi' ); const skipLiveSnippets = process.argv.includes( '--skip-snippets' ); diff --git a/scripts/docs/buildapi.js b/scripts/docs/buildapi.js index 3b45d4c24a9..fe471d342a6 100644 --- a/scripts/docs/buildapi.js +++ b/scripts/docs/buildapi.js @@ -9,7 +9,7 @@ const path = require( 'path' ); -const assertIsInstalled = require( './../util/assertisinstalled' ); +const assertIsInstalled = require( './../utils/assertisinstalled' ); module.exports = function buildApiDocs() { assertIsInstalled( '@ckeditor/ckeditor5-dev-docs' ); diff --git a/scripts/util/assertisinstalled.js b/scripts/utils/assertisinstalled.js similarity index 100% rename from scripts/util/assertisinstalled.js rename to scripts/utils/assertisinstalled.js From 66258925e672496f66fcdc04ba420dd2b4b77a6d Mon Sep 17 00:00:00 2001 From: Kamil Piechaczek Date: Tue, 17 Oct 2017 13:13:17 +0200 Subject: [PATCH 09/12] Renamed util to utils (missed files). --- scripts/release/changelog-dependencies.js | 2 +- scripts/release/release-dependencies.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/release/changelog-dependencies.js b/scripts/release/changelog-dependencies.js index f6b4631b19a..e68ca6417ca 100755 --- a/scripts/release/changelog-dependencies.js +++ b/scripts/release/changelog-dependencies.js @@ -9,7 +9,7 @@ 'use strict'; -const assertIsInstalled = require( './../util/assertisinstalled' ); +const assertIsInstalled = require( './../utils/assertisinstalled' ); assertIsInstalled( '@ckeditor/ckeditor5-dev-env' ); diff --git a/scripts/release/release-dependencies.js b/scripts/release/release-dependencies.js index 717f04b2095..02768fd413c 100755 --- a/scripts/release/release-dependencies.js +++ b/scripts/release/release-dependencies.js @@ -9,7 +9,7 @@ 'use strict'; -const assertIsInstalled = require( './../util/assertisinstalled' ); +const assertIsInstalled = require( './../utils/assertisinstalled' ); assertIsInstalled( '@ckeditor/ckeditor5-dev-env' ); From 77335d875580da85a4ed0fc01eee2adb06660428 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Piotrek=20Koszuli=C5=84ski?= Date: Mon, 13 Nov 2017 12:39:52 +0100 Subject: [PATCH 10/12] Bumped up deps. --- package.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index dd3071fa8ac..4a1857665d0 100644 --- a/package.json +++ b/package.json @@ -45,8 +45,8 @@ "@ckeditor/ckeditor5-widget": "^1.0.0-alpha.1" }, "devDependencies": { - "@ckeditor/ckeditor5-dev-docs": "^7.5.1", - "@ckeditor/ckeditor5-dev-tests": "^8.2.5", + "@ckeditor/ckeditor5-dev-docs": "^8.0.0", + "@ckeditor/ckeditor5-dev-tests": "^9.0.0", "eslint": "^4.8.0", "eslint-config-ckeditor5": "^1.0.6", "husky": "^0.14.3", From 0681879e83bd8ed63c1111028ffabf6ead781d9c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Piotrek=20Koszuli=C5=84ski?= Date: Mon, 13 Nov 2017 13:22:55 +0100 Subject: [PATCH 11/12] Switch to published ckeditor5-cloudservices. --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 4a1857665d0..7d6aafecd1c 100644 --- a/package.json +++ b/package.json @@ -21,7 +21,7 @@ "@ckeditor/ckeditor5-build-classic": "^1.0.0-alpha.1", "@ckeditor/ckeditor5-build-inline": "^1.0.0-alpha.1", "@ckeditor/ckeditor5-clipboard": "^1.0.0-alpha.1", - "@ckeditor/ckeditor5-cloudeservices": "ckeditor/ckeditor5-cloudservices", + "@ckeditor/ckeditor5-cloudeservices": "^0.0.1", "@ckeditor/ckeditor5-core": "^1.0.0-alpha.1", "@ckeditor/ckeditor5-easy-image": "^1.0.0-alpha.1", "@ckeditor/ckeditor5-editor-balloon": "^1.0.0-alpha.1", From 1c5eec9393dcb635d9144bd2bca9cbee50d84a49 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Piotrek=20Koszuli=C5=84ski?= Date: Mon, 13 Nov 2017 13:29:11 +0100 Subject: [PATCH 12/12] Ekhm. --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 7d6aafecd1c..5bfe2e65c9f 100644 --- a/package.json +++ b/package.json @@ -21,7 +21,7 @@ "@ckeditor/ckeditor5-build-classic": "^1.0.0-alpha.1", "@ckeditor/ckeditor5-build-inline": "^1.0.0-alpha.1", "@ckeditor/ckeditor5-clipboard": "^1.0.0-alpha.1", - "@ckeditor/ckeditor5-cloudeservices": "^0.0.1", + "@ckeditor/ckeditor5-cloudservices": "^0.0.1", "@ckeditor/ckeditor5-core": "^1.0.0-alpha.1", "@ckeditor/ckeditor5-easy-image": "^1.0.0-alpha.1", "@ckeditor/ckeditor5-editor-balloon": "^1.0.0-alpha.1",