Skip to content

Commit

Permalink
Remove and migrate dependency ckeditor5-dev-webpack-plugin (#2216)
Browse files Browse the repository at this point in the history
* Update dependencies: @ckeditor/ckeditor5-dev-webpack-plugin, @types/ckeditor__ckeditor5-core, swc-loader

* Add back ckeditor5-core
  • Loading branch information
ibrahimjaved12 authored Aug 2, 2024
1 parent d0a733e commit 8ec5f4f
Show file tree
Hide file tree
Showing 7 changed files with 356 additions and 358 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@
"@ckeditor/ckeditor5-block-quote": "^35.4.0",
"@ckeditor/ckeditor5-code-block": "35.4.0",
"@ckeditor/ckeditor5-core": "^35.4.0",
"@ckeditor/ckeditor5-dev-translations": "^32.0.0",
"@ckeditor/ckeditor5-dev-utils": "^26.1.0",
"@ckeditor/ckeditor5-dev-webpack-plugin": "^26.1.0",
"@ckeditor/ckeditor5-easy-image": "^35.4.0",
"@ckeditor/ckeditor5-editor-classic": "^35.4.0",
"@ckeditor/ckeditor5-engine": "^35.4.0",
Expand Down
2 changes: 1 addition & 1 deletion static/js/components/widgets/RelationField.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -384,7 +384,7 @@ export default function RelationField(props: Props): JSX.Element {
cacheUniques={[focusedWebsite]}
value={selectedIds.map((id) => {
const content = contentMap.get(id)
const title = content ? content.title ?? id : id
const title = content ? (content.title ?? id) : id

return {
id,
Expand Down
2 changes: 1 addition & 1 deletion static/js/lib/site_content.ts
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,7 @@ export const newInitialValues = (
field.name,
field.widget === WidgetVariant.Object
? newInitialValues(field.fields, website)
: field.default ?? defaultForField(field, website),
: (field.default ?? defaultForField(field, website)),
]),
)

Expand Down
6 changes: 4 additions & 2 deletions webpack.config.dev.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@ const path = require("path")
const R = require("ramda")
const BundleTracker = require("webpack-bundle-tracker")
const { config } = require(path.resolve("./webpack.config.shared.js"))
const CKEditorWebpackPlugin = require("@ckeditor/ckeditor5-dev-webpack-plugin")
const {
CKEditorTranslationsPlugin,
} = require("@ckeditor/ckeditor5-dev-translations")

const hotEntry = (host, port) =>
`webpack-hot-middleware/client?path=http://${host}:${port}/__webpack_hmr&timeout=20000&reload=true`
Expand All @@ -25,7 +27,7 @@ const devConfig = Object.assign({}, config, {
plugins: [
new webpack.HotModuleReplacementPlugin(),
new BundleTracker({ filename: "./webpack-stats.json" }),
new CKEditorWebpackPlugin({
new CKEditorTranslationsPlugin({
language: "en",
addMainLanguageTranslationsToAllAssets: true,
}),
Expand Down
6 changes: 4 additions & 2 deletions webpack.config.prod.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@ const path = require("path")
const BundleTracker = require("webpack-bundle-tracker")
const MiniCssExtractPlugin = require("mini-css-extract-plugin")
const { config } = require(path.resolve("./webpack.config.shared.js"))
const CKEditorWebpackPlugin = require("@ckeditor/ckeditor5-dev-webpack-plugin")
const {
CKEditorTranslationsPlugin,
} = require("@ckeditor/ckeditor5-dev-translations")

const prodConfig = Object.assign({}, config)
prodConfig.module.rules = [
Expand Down Expand Up @@ -48,7 +50,7 @@ module.exports = Object.assign(prodConfig, {
new MiniCssExtractPlugin({
filename: "[name]-[contenthash].css",
}),
new CKEditorWebpackPlugin({
new CKEditorTranslationsPlugin({
language: "en",
addMainLanguageTranslationsToAllAssets: true,
}),
Expand Down
7 changes: 5 additions & 2 deletions webpack.config.shared.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
const path = require("path")
// eslint-disable-next-line no-unused-vars
const webpack = require("webpack")
// eslint-disable-next-line no-unused-vars
const CKEditorWebpackPlugin = require("@ckeditor/ckeditor5-dev-webpack-plugin")
/* eslint-disable no-unused-vars */
const {
CKEditorTranslationsPlugin,
} = require("@ckeditor/ckeditor5-dev-translations")
/* eslint-enable no-unused-vars */
const { styles } = require("@ckeditor/ckeditor5-dev-utils")

module.exports = {
Expand Down
Loading

0 comments on commit 8ec5f4f

Please sign in to comment.