-
-
Notifications
You must be signed in to change notification settings - Fork 3.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #602 from ckeditor/t/473
Internal: Removed gulp dependency in favor of npm scripts. Closes #473.
- Loading branch information
Showing
12 changed files
with
220 additions
and
34 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
#!/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( './../utils/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' ); | ||
|
||
buildDocs(); | ||
|
||
function buildDocs() { | ||
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() ); | ||
|
||
return; | ||
} | ||
|
||
// 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 | ||
} ); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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( './../utils/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' | ||
} ); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
#!/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( './../utils/assertisinstalled' ); | ||
|
||
assertIsInstalled( '@ckeditor/ckeditor5-dev-env' ); | ||
|
||
const devEnv = require( '@ckeditor/ckeditor5-dev-env' ); | ||
const commonOptions = { | ||
cwd: process.cwd(), | ||
packages: 'packages' | ||
}; | ||
const editorBuildsGlob = '@ckeditor/ckeditor5-build-*'; | ||
|
||
const optionsForDependencies = Object.assign( {}, commonOptions, { | ||
skipPackages: editorBuildsGlob | ||
} ); | ||
const optionsForBuilds = Object.assign( {}, commonOptions, { | ||
scope: editorBuildsGlob | ||
} ); | ||
|
||
Promise.resolve() | ||
.then( () => devEnv.generateChangelogForSubRepositories( optionsForDependencies ) ) | ||
.then( () => devEnv.generateSummaryChangelog( optionsForBuilds ) ) | ||
.then( () => { | ||
console.log( 'Done!' ); | ||
} ) | ||
.catch( err => { | ||
console.error( err.stack ); | ||
} ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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( './../utils/assertisinstalled' ); | ||
|
||
assertIsInstalled( '@ckeditor/ckeditor5-dev-env' ); | ||
|
||
require( '@ckeditor/ckeditor5-dev-env' ) | ||
.releaseSubRepositories( { | ||
cwd: process.cwd(), | ||
packages: 'packages' | ||
} ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 ); | ||
} | ||
}; |