Explorar o código

Merge branch 'docs' into t/243

Kamil Piechaczek %!s(int64=9) %!d(string=hai) anos
pai
achega
8f519de0c6
Modificáronse 2 ficheiros con 1 adicións e 77 borrados
  1. 1 75
      gulpfile.js
  2. 0 2
      package.json

+ 1 - 75
gulpfile.js

@@ -131,14 +131,7 @@ gulp.task( 'bundle:generate',
 	ckeditor5DevBundler.generateFromConfig
 );
 
-// Task specific for building editors for testing releases.
-gulp.task( 'compile:bundled-sample-tests:build-editors',
-	[
-		'compile:js:esnext',
-		'compile:themes:esnext'
-	],
-	buildEditorsForSamples
-);
+// Documentation. -------------------------------------------------------------
 
 // Documentation. -------------------------------------------------------------
 
@@ -154,70 +147,3 @@ gulp.task( 'docs:prepare-files', [ 'docs:prepare-files:clean' ], docsBuilder.col
 // Build editors for samples.
 gulp.task( 'docs:editors:clean', docsBuilder.removeBuiltEditors );
 gulp.task( 'docs:editors', [ 'docs:editors:clean', 'compile:js:esnext' ], docsBuilder.buildSamplesEditors );
-
-// Testing. -------------------------------------------------------------------
-
-// TODO The below code is here only temporarily. It will be extracted to a separate package
-// once we'll understand better where it should belong. Right now it's somewhere beyond testing
-// environment, compilation and documentation.
-
-/**
- * Prepares configurations for bundler based on sample files and builds editors
- * based on prepared configuration.
- *
- * You can find more details in: https://github.com/ckeditor/ckeditor5/issues/260
- *
- * @returns {Stream}
- */
-function buildEditorsForSamples() {
-	const { stream, tools } = require( '@ckeditor/ckeditor5-dev-utils' );
-	const { utils: docsUtils } = require( '@ckeditor/ckeditor5-dev-docs' );
-
-	const gulpFilter = require( 'gulp-filter' );
-	const gulpRename = require( 'gulp-rename' );
-	const path = require( 'path' );
-
-	const bundleDir = path.join( config.ROOT_DIR, config.BUNDLE_DIR );
-
-	return docsUtils.getSamplesStream( config.ROOT_DIR, config.DOCUMENTATION.SAMPLES )
-		.pipe( gulpFilter( ( file ) => path.extname( file.path ) === '.js' ) )
-		.pipe( gulpRename( ( file ) => {
-			file.dirname = file.dirname.replace( '/docs/samples', '' );
-		} ) )
-		.pipe( stream.noop( ( file ) => {
-			const bundleConfig = docsUtils.getBundlerConfigFromSample( file.contents.toString( 'utf-8' ) );
-			bundleConfig.format = 'iife';
-			bundleConfig.path = file.path.match( /\/samples\/(.*)\.js$/ )[ 1 ];
-
-			const splitPath = bundleConfig.path.split( path.sep );
-			const packageName = splitPath[ 0 ];
-
-			// Clean the output paths.
-			return ckeditor5DevBundler.clean( bundleConfig )
-				// Then bundle a editor.
-				.then( () => ckeditor5DevBundler.generate( bundleConfig ) )
-				// Then copy created files.
-				.then( () => {
-					const beginPath = splitPath.slice( 1, -1 ).join( path.sep ) || '.';
-					const fileName = splitPath.slice( -1 ).join();
-					const builtEditorPath = path.join( bundleDir, bundleConfig.path, bundleConfig.moduleName );
-					const destinationPath = path.join.apply( null, [
-						config.MODULE_DIR.amd,
-						'tests',
-						packageName,
-						'samples',
-						beginPath,
-						'_assets',
-						fileName
-					] );
-
-					// Copy editor builds to proper directory.
-					return Promise.all( [
-						tools.copyFile( `${ builtEditorPath }.js`, `${ destinationPath }.js` ),
-						tools.copyFile( `${ builtEditorPath }.css`, `${ destinationPath }.css` )
-					] );
-				} )
-				// And clean up.
-				.then( () => tools.clean( path.join( config.BUNDLE_DIR, packageName, '..' ), packageName ) );
-		} ) );
-}

+ 0 - 2
package.json

@@ -39,8 +39,6 @@
     "@ckeditor/ckeditor5-dev-lint": "^1.0.1",
     "@ckeditor/ckeditor5-dev-utils": "ckeditor/ckeditor5-dev-utils",
     "gulp": "^3.9.0",
-    "gulp-filter": "^4.0.0",
-    "gulp-rename": "^1.2.2",
     "guppy-pre-commit": "^0.3.0",
     "run-sequence": "^1.1.5"
   },