From f01941d5e6ba6db1e0821c6c74209bc3acd1c040 Mon Sep 17 00:00:00 2001 From: Kamil Piechaczek Date: Thu, 21 Sep 2017 10:23:38 +0200 Subject: [PATCH 1/4] Moved "ckeditor.js" file to "src/" directory. --- bin/create-entry-file.js | 3 ++- package.json | 2 +- ckeditor.js => src/ckeditor.js | 2 +- webpack.config.js | 2 +- 4 files changed, 5 insertions(+), 4 deletions(-) rename ckeditor.js => src/ckeditor.js (96%) diff --git a/bin/create-entry-file.js b/bin/create-entry-file.js index 6c58130..1a81d9d 100755 --- a/bin/create-entry-file.js +++ b/bin/create-entry-file.js @@ -7,11 +7,12 @@ 'use strict'; +const path = require( 'path' ); const { bundler } = require( '@ckeditor/ckeditor5-dev-utils' ); const buildConfig = require( '../build-config' ); console.log( 'Creating the entry file...' ); -bundler.createEntryFile( 'ckeditor.js', buildConfig ); +bundler.createEntryFile( path.join( 'src', 'ckeditor.js' ), buildConfig ); console.log( 'Done.' ); diff --git a/package.json b/package.json index a4e171d..80c9b5d 100644 --- a/package.json +++ b/package.json @@ -49,6 +49,6 @@ "create-entry-file": "./bin/create-entry-file.js", "build-ckeditor": "./bin/build-ckeditor.sh", - "preversion": "npm run build; if [ -n \"$(git status ckeditor.js build/ --porcelain)\" ]; then git add -u ckeditor.js build/ && git commit -m 'Internal: Build.'; fi" + "preversion": "npm run build; if [ -n \"$(git status src/ckeditor.js build/ --porcelain)\" ]; then git add -u src/ckeditor.js build/ && git commit -m 'Internal: Build.'; fi" } } diff --git a/ckeditor.js b/src/ckeditor.js similarity index 96% rename from ckeditor.js rename to src/ckeditor.js index 28239e8..87bddb1 100644 --- a/ckeditor.js +++ b/src/ckeditor.js @@ -18,7 +18,7 @@ import LinkPlugin from '@ckeditor/ckeditor5-link/src/link'; import ListPlugin from '@ckeditor/ckeditor5-list/src/list'; import ParagraphPlugin from '@ckeditor/ckeditor5-paragraph/src/paragraph'; -export default class ClassicEditor extends ClassicEditorBase {} +export class ClassicEditor extends ClassicEditorBase {} ClassicEditor.build = { plugins: [ diff --git a/webpack.config.js b/webpack.config.js index 061845a..d43441e 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -17,7 +17,7 @@ const buildConfig = require( './build-config' ); module.exports = { devtool: 'source-map', - entry: path.resolve( __dirname, 'ckeditor.js' ), + entry: path.resolve( __dirname, 'src', 'ckeditor.js' ), output: { path: path.resolve( __dirname, 'build' ), From 3b47531f67d487a934b522ed8db6500b6b59f9fd Mon Sep 17 00:00:00 2001 From: Kamil Piechaczek Date: Thu, 21 Sep 2017 10:24:23 +0200 Subject: [PATCH 2/4] Moved all deps as devDeps (package.json). --- package.json | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/package.json b/package.json index 80c9b5d..b2563e2 100644 --- a/package.json +++ b/package.json @@ -9,21 +9,19 @@ "rich-text editor" ], "main": "./build/ckeditor.js", - "dependencies": { - "@ckeditor/ckeditor5-editor-classic": "^0.8.0", - "@ckeditor/ckeditor5-essentials": "^0.3.0", + "devDependencies": { "@ckeditor/ckeditor5-autoformat": "^0.6.0", "@ckeditor/ckeditor5-basic-styles": "^0.9.0", "@ckeditor/ckeditor5-block-quote": "^0.2.0", + "@ckeditor/ckeditor5-dev-utils": "^4.0.0", + "@ckeditor/ckeditor5-dev-webpack-plugin": "^2.0.11", + "@ckeditor/ckeditor5-editor-classic": "^0.8.0", + "@ckeditor/ckeditor5-essentials": "^0.3.0", "@ckeditor/ckeditor5-heading": "^0.10.0", "@ckeditor/ckeditor5-image": "^0.7.0", "@ckeditor/ckeditor5-link": "^0.8.0", "@ckeditor/ckeditor5-list": "^0.7.0", - "@ckeditor/ckeditor5-paragraph": "^0.9.0" - }, - "devDependencies": { - "@ckeditor/ckeditor5-dev-utils": "^4.0.0", - "@ckeditor/ckeditor5-dev-webpack-plugin": "^2.0.11", + "@ckeditor/ckeditor5-paragraph": "^0.9.0", "babel-minify-webpack-plugin": "^0.2.0", "css-loader": "^0.28.5", "node-sass": "^4.5.3", From eca7e89b93ebc811269d431696ce1b4b5f24df31 Mon Sep 17 00:00:00 2001 From: Kamil Piechaczek Date: Wed, 27 Sep 2017 10:04:19 +0200 Subject: [PATCH 3/4] Source file should export the editor as default. --- src/ckeditor.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ckeditor.js b/src/ckeditor.js index 87bddb1..28239e8 100644 --- a/src/ckeditor.js +++ b/src/ckeditor.js @@ -18,7 +18,7 @@ import LinkPlugin from '@ckeditor/ckeditor5-link/src/link'; import ListPlugin from '@ckeditor/ckeditor5-list/src/list'; import ParagraphPlugin from '@ckeditor/ckeditor5-paragraph/src/paragraph'; -export class ClassicEditor extends ClassicEditorBase {} +export default class ClassicEditor extends ClassicEditorBase {} ClassicEditor.build = { plugins: [ From 169fdf2207f69bcbe40c01f4cdfee5432749be7d Mon Sep 17 00:00:00 2001 From: Kamil Piechaczek Date: Thu, 28 Sep 2017 08:34:40 +0200 Subject: [PATCH 4/4] Added files key to package.json and removed .npmignore file. --- .npmignore | 2 -- package.json | 3 +++ 2 files changed, 3 insertions(+), 2 deletions(-) delete mode 100644 .npmignore diff --git a/.npmignore b/.npmignore deleted file mode 100644 index bbd12ca..0000000 --- a/.npmignore +++ /dev/null @@ -1,2 +0,0 @@ -tests/** -sample/** diff --git a/package.json b/package.json index b2563e2..bb6d33c 100644 --- a/package.json +++ b/package.json @@ -9,6 +9,9 @@ "rich-text editor" ], "main": "./build/ckeditor.js", + "files": [ + "build" + ], "devDependencies": { "@ckeditor/ckeditor5-autoformat": "^0.6.0", "@ckeditor/ckeditor5-basic-styles": "^0.9.0",