8
0
فهرست منبع

Added package to switch-to-dev-dev script.

Maciej Bukowski 9 سال پیش
والد
کامیت
cf99c78717
3فایلهای تغییر یافته به همراه9 افزوده شده و 4 حذف شده
  1. 1 1
      package.json
  2. 3 3
      scripts/fix-src-imports.js
  3. 5 0
      scripts/switch-to-dev-dev.sh

+ 1 - 1
package.json

@@ -29,8 +29,8 @@
   },
   "devDependencies": {
     "@ckeditor/ckeditor5-dev-docs": "^6.1.0",
-    "@ckeditor/ckeditor5-dev-lint": "^2.0.0",
     "@ckeditor/ckeditor5-dev-env": "^2.0.0",
+    "@ckeditor/ckeditor5-dev-lint": "^2.0.0",
     "@ckeditor/ckeditor5-dev-tests": "^6.1.0",
     "gulp": "^3.9.0",
     "guppy-pre-commit": "^0.4.0",

+ 3 - 3
scripts/fix-src-imports.js

@@ -12,7 +12,7 @@ const path = require( 'path' );
 const glob = require( 'glob' );
 
 const srcDir = path.join( process.cwd(), 'src' );
-const srcPath = path.join( srcDir , '**', '*.js' );
+const srcPath = path.join( srcDir, '**', '*.js' );
 
 for ( const filePath of glob.sync( srcPath ) ) {
 	const fileDepth = countOcurrences( filePath.replace( srcDir + '/', '' ), path.sep );
@@ -21,12 +21,12 @@ for ( const filePath of glob.sync( srcPath ) ) {
 	const fileContent = fs.readFileSync( filePath, 'utf-8' )
 		.replace( /\nimport[^']+?'((\.\.\/)+[\w-]+)\/[^']+?'/gm, fix );
 
-	fs.writeFileSync( filePath, fileContent , 'utf-8' );
+	fs.writeFileSync( filePath, fileContent, 'utf-8' );
 }
 
 function fixImport( wholeImport, pathStart, fileDepth ) {
 	const indexOfPathStart = wholeImport.indexOf( '../' );
-	const packageShortName = pathStart.split( '/' ).slice( -1 )[0];
+	const packageShortName = pathStart.split( '/' ).slice( -1 )[ 0 ];
 	const importDepth = countOcurrences( pathStart, '../' );
 
 	if ( importDepth <= fileDepth ) {

+ 5 - 0
scripts/switch-to-dev-dev.sh

@@ -34,3 +34,8 @@ echo "Linking ckeditor5-dev-webpack-plugin..."
 
 rm -rf node_modules/@ckeditor/ckeditor5-dev-webpack-plugin
 ln -s ../../../ckeditor5-dev/packages/ckeditor5-dev-webpack-plugin node_modules/@ckeditor
+
+echo "Linking ckeditor5-dev-utils..."
+
+rm -rf node_modules/@ckeditor/ckeditor5-dev-utils
+ln -s ../../../ckeditor5-dev/packages/ckeditor5-dev-utils node_modules/@ckeditor