diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 000000000..37ea8ff91 --- /dev/null +++ b/.editorconfig @@ -0,0 +1,19 @@ +# Configurations to normalize the IDE behavior. +# http://editorconfig.org/ + +root = true + +[*] +indent_style = tab +tab_width = 4 +charset = utf-8 +end_of_line = lf +trim_trailing_whitespace = true +insert_final_newline = true + +[*.{js,jsx,ts}] +quote_type = single + +[package.json] +indent_style = space +tab_width = 2 diff --git a/.eslintrc.js b/.eslintrc.js new file mode 100644 index 000000000..96255cb44 --- /dev/null +++ b/.eslintrc.js @@ -0,0 +1,25 @@ +/* eslint-env node */ + +'use strict'; + +module.exports = { + extends: 'ckeditor5', + root: true, + rules: { + // This rule disallows importing core DLL packages directly. Imports should be done using the `ckeditor5` package. + // Also, importing non-DLL packages is not allowed. If the package requires other features to work, they should be + // specified as soft-requirements. + // Read more: https://ckeditor.com/docs/ckeditor5/latest/builds/guides/migration/migration-to-26.html#soft-requirements. + 'ckeditor5-rules/ckeditor-imports': 'error' + }, + overrides: [ + { + files: [ 'tests/**/*.js', 'sample/**/*.js' ], + rules: { + // To write complex tests, you may need to import files that are not exported in DLL files by default. + // Hence, imports CKEditor 5 packages in test files are not checked. + 'ckeditor5-rules/ckeditor-imports': 'off' + } + } + ] +}; diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 000000000..9c20d56f7 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,18 @@ +* text=auto + +*.htaccess eol=lf +*.cgi eol=lf +*.sh eol=lf + +*.css text +*.htm text +*.html text +*.js text +*.json text +*.php text +*.txt text +*.md text + +*.png -text +*.gif -text +*.jpg -text diff --git a/.gitignore b/.gitignore new file mode 100644 index 000000000..249e13209 --- /dev/null +++ b/.gitignore @@ -0,0 +1,7 @@ +.nyc_output/ +coverage/ +node_modules/ +yarn.lock +tmp/ +build/ +yarn.error \ No newline at end of file diff --git a/.stylelintrc b/.stylelintrc new file mode 100644 index 000000000..1d86a41f9 --- /dev/null +++ b/.stylelintrc @@ -0,0 +1,3 @@ +{ + "extends": "stylelint-config-ckeditor5" +} diff --git a/package.json b/package.json index 3394014d5..c42e0ac41 100644 --- a/package.json +++ b/package.json @@ -47,10 +47,41 @@ "@ckeditor/ckeditor5-typing": "^32.0.0", "@ckeditor/ckeditor5-undo": "^32.0.0", "@ckeditor/ckeditor5-widget": "^32.0.0", + "@ckeditor/ckeditor5-package-tools": "^1.0.0-beta.4", + "@ckeditor/ckeditor5-theme-lark": ">=32.0.0", "eslint": "^7.32.0", - "eslint-config-ckeditor5": ">=3.1.1" + "eslint-config-ckeditor5": ">=3.1.1", + "http-server": "^14.1.0", + "husky": "^4.2.5", + "lint-staged": "^10.2.6", + "stylelint": "^13.13.1", + "stylelint-config-ckeditor5": ">=2.0.1" }, + "scripts": { - "dll:build": "webpack" + "dll:build": "ckeditor5-package-tools dll:build", + "dll:serve": "http-server ./ -o sample/dll.html", + "lint": "eslint \"**/*.js\" --quiet --ignore-pattern \"build/\"", + "start": "ckeditor5-package-tools start", + "stylelint": "stylelint --quiet --allow-empty-input 'theme/*.css'", + "test": "ckeditor5-package-tools test", + "prepare": "yarn run dll:build", + "prepublishOnly": "yarn run dll:build", + "translations:collect": "ckeditor5-package-tools translations:collect", + "translations:download": "ckeditor5-package-tools translations:download", + "translations:upload": "ckeditor5-package-tools translations:upload" + }, + "lint-staged": { + "**/*.js": [ + "eslint --quiet" + ], + "**/*.css": [ + "stylelint --quiet --allow-empty-input" + ] + }, + "husky": { + "hooks": { + "pre-commit": "lint-staged" + } } } \ No newline at end of file