Skip to content

Commit

Permalink
feat: Strapi v5 support, closes #148
Browse files Browse the repository at this point in the history
  • Loading branch information
nshenderov committed Sep 19, 2024
1 parent e522791 commit bed310e
Show file tree
Hide file tree
Showing 49 changed files with 13,432 additions and 276 deletions.
130 changes: 130 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,112 @@
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.

############################
# OS X
############################

.DS_Store
.AppleDouble
.LSOverride
Icon
.Spotlight-V100
.Trashes
._*


############################
# Linux
############################

*~


############################
# Windows
############################

Thumbs.db
ehthumbs.db
Desktop.ini
$RECYCLE.BIN/
*.cab
*.msi
*.msm
*.msp


############################
# Packages
############################

*.7z
*.csv
*.dat
*.dmg
*.gz
*.iso
*.jar
*.rar
*.tar
*.zip
*.com
*.class
*.dll
*.exe
*.o
*.seed
*.so
*.swo
*.swp
*.swn
*.swm
*.out
*.pid


############################
# Logs and databases
############################

.tmp
*.log
*.sql
*.sqlite
*.sqlite3


############################
# Misc.
############################

*#
ssl
.idea
nbproject
.tsbuildinfo
.eslintcache
.env


############################
# Strapi
############################

public/uploads/*
!public/uploads/.gitkeep


############################
# Build
############################

dist
build


############################
# Node.js
############################

lib-cov
lcov.info
pids
Expand All @@ -6,3 +115,24 @@ results
node_modules
.node_history


############################
# Package managers
############################

.yarn/*
!.yarn/cache
!.yarn/unplugged
!.yarn/patches
!.yarn/releases
!.yarn/sdks
!.yarn/versions
.pnp.*
yarn-error.log


############################
# Tests
############################

coverage
2 changes: 1 addition & 1 deletion .release-it.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ module.exports = {
types: [
{ type: "feat", section: "🚀 Features" },
{ type: "fix", section: "👾 Bug Fixes" },
{ type: "docs", section: "📜 Docs" },
{ type: "docs", section: "📚 Docs" },
{ type: "chore", section: "⚙️ Chore" },
{ type: "style", section: "💅 Style" }
]
Expand Down
50 changes: 19 additions & 31 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -546,57 +546,45 @@ const CKEConfig = () => {
## <a id="contributing"></a>🛠 Contributing
___
This section covers how to configure your environment if you want to contribute to this package.
This section explains how to set up your environment if you want to contribute to this package.
To start making changes to the plugin, you first need to install the Strapi infrastructure on top of the plugin repository:
Clone the repository:
```bash
git clone https://github.com/nshenderov/strapi-plugin-ckeditor.git ./strapi-plugin-ckeditor
```
npx create-strapi-app --quickstart strapi
cd strapi
```
By default, Strapi does not create a `plugins` folder, so we need to create it:
```
mkdir -p src/plugins
```
Now we should clone this repository so we can work on it.
```
git clone git@github.com:nshenderov/strapi-plugin-ckeditor.git src/plugins/strapi-plugin-ckeditor
```
Add an entry inside the `./package.json` file so we won't need to use yarn inside the plugin itself:
Navigate to the downloaded folder:
```
"workspaces": ["./src/plugins/strapi-plugin-ckeditor"]
```bash
cd ./strapi-plugin-ckeditor
```
Install dependencies:
```
```bash
yarn install
```
Now we need to register the plugin so Strapi can use it. To do that, we need to create the `./config/plugins.js` file (if it doesn't already exist) and add an entry to it:
Link the plugin to your project:
In the plugin directory, run:
```bash
yarn watch:link
```
module.exports = ({ env }) => ({
ckeditor5: {
enabled: true,
resolve: "./src/plugins/strapi-plugin-ckeditor"
},
});
In your project directory, run:
```bash
yarn dlx yalc add --link @_sh/strapi-plugin-ckeditor && yarn install
```
Rebuild the project and start the server:
```
```bash
yarn build
yarn develop
```
## <a id="migration"></a>✈️ Migration
### From v2 to v3
Expand Down Expand Up @@ -702,6 +690,6 @@ const CKEConfig = () => ({
## <a id="requirements"></a>⚠️ Requirements
___
Strapi **v4.13.0+**
Strapi **v5.0.0+**
Node **>=18.0.0 <=20.x.x**
10 changes: 10 additions & 0 deletions admin/jsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"compilerOptions": {
"target": "es6",
"jsx": "react",
"module": "esnext",
"allowSyntheticDefaultImports": true,
"esModuleInterop": true
},
"include": ["./src/**/*.js", "./src/**/*.jsx"]
}
34 changes: 19 additions & 15 deletions admin/src/CKEditorIcon.js → admin/src/CKEditorIcon.jsx
Original file line number Diff line number Diff line change
@@ -1,22 +1,21 @@
import * as React from "react";
import styled from "styled-components";
import { Icon } from "@strapi/design-system";
import { Flex } from "@strapi/design-system";
import * as React from 'react';
import { styled } from 'styled-components';
import { Flex } from '@strapi/design-system';

const IconBox = styled(Flex)`
background-color: #f0f0ff; /* primary100 */
border: 1px solid #d9d8ff; /* primary200 */
svg > path {
fill: #4945ff; /* primary600 */
}
`;
`;

const SvgIcon = () => (
<svg
width="68"
height="64"
viewBox="-20 -14 98 94"
xmlns="http://www.w3.org/2000/svg"
width="68"
height="64"
viewBox="-20 -14 98 94"
xmlns="http://www.w3.org/2000/svg"
>
<g fill="none" fill-rule="evenodd">
<path
Expand All @@ -37,10 +36,15 @@ const SvgIcon = () => (
</svg>
);

const CKEditorIcon = () => (
<IconBox justifyContent="center" alignItems="center" width={7} height={6} hasRadius aria-hidden>
<Icon as={SvgIcon} />
export const CKEditorIcon = () => (
<IconBox
justifyContent="center"
alignItems="center"
width={7}
height={6}
hasRadius
aria-hidden
>
<SvgIcon />
</IconBox>
)

export default CKEditorIcon;
);
45 changes: 0 additions & 45 deletions admin/src/Input/config/language.js

This file was deleted.

Loading

0 comments on commit bed310e

Please sign in to comment.