Skip to content

Commit

Permalink
2.46.0
Browse files Browse the repository at this point in the history
  • Loading branch information
JiHong88 committed Apr 14, 2024
2 parents 9799bc7 + d9797fc commit 7554d75
Show file tree
Hide file tree
Showing 25 changed files with 1,459 additions and 529 deletions.
65 changes: 65 additions & 0 deletions .github/scripts/manage-deploy.js
@@ -0,0 +1,65 @@
require("dotenv").config();
const { Octokit } = require("@octokit/rest");

const octokit = new Octokit({
auth: process.env.GITHUB_TOKEN,
});

async function closeIssuesForMilestone() {
const owner = "jihong88";
const repo = "suneditor";
const versionName = process.env.VERSION_NAME;

if (!versionName) {
console.log("No version name provided");
return;
}

try {
const milestones = await octokit.rest.issues.listMilestones({
owner,
repo,
state: "open",
});

const milestone = milestones.data.find((m) => m.title === versionName);
if (!milestone) {
console.log("No matching milestone found");
return;
}

const issues = await octokit.issues.listForRepo({
owner,
repo,
state: "open",
milestone: milestone.number,
});

issues.data.forEach(async (issue) => {
const comment = {
owner,
repo,
issue_number: issue.number,
body:
"Thank you for your engagement with the project.\n" +
"This issue has been resolved for version " +
versionName +
".\n" +
"If the problem persists or if you believe this issue is still relevant,\n" +
"please reopen it with additional comments.",
};
await octokit.issues.createComment(comment);

await octokit.issues.update({
owner,
repo,
issue_number: issue.number,
state: "closed",
});
});
} catch (error) {
console.error(`Error while processing issues for milestone: ${error}`);
}
}

closeIssuesForMilestone();
52 changes: 52 additions & 0 deletions .github/scripts/manage-issues.js
@@ -0,0 +1,52 @@
require("dotenv").config();
const { Octokit } = require("@octokit/rest");

const octokit = new Octokit({
auth: process.env.GITHUB_TOKEN,
});

async function closeOldIssues() {
try {
const owner = "jihong88";
const repo = "suneditor";
const issues = await octokit.issues.listForRepo({
owner,
repo,
state: "open",
});

const sixWeeksAgo = new Date();
sixWeeksAgo.setDate(sixWeeksAgo.getDate() - 42); // 6 weeks

for (const issue of issues.data) {
const lastUpdated = new Date(issue.updated_at);
if (lastUpdated < sixWeeksAgo) {
const comment = {
owner,
repo,
issue_number: issue.number,
body:
"Thank you for your engagement with the project.\n" +
"Due to a lack of activity for over 6 weeks, this issue has been automatically closed." +
"\nThis is part of the process to keep the project up-to-date.\n\n" +
"If a new version has been released recently, please test your scenario with that version to see if the issue persists.\n" +
"If the problem still exists or if you believe this issue is still relevant, \n" +
"feel free to reopen it and provide additional comments.\n\n" +
"I truly appreciate your continuous interest and support for the project. Your feedback is crucial in improving its quality.",
};
await octokit.issues.createComment(comment);

await octokit.issues.update({
owner,
repo,
issue_number: issue.number,
state: "closed",
});
}
}
} catch (error) {
console.error(`Error while closing issues: ${error}`);
}
}

closeOldIssues();
49 changes: 49 additions & 0 deletions .github/workflows/deploy-manager.yml
@@ -0,0 +1,49 @@
name: Deploy Management Action

on:
push:
branches:
- release

jobs:
deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2

- name: Setup Node.js
uses: actions/setup-node@v2
with:
node-version: "12"
registry-url: "https://registry.npmjs.org/"

- name: Check if version has been updated
id: check-version
run: |
PACKAGE_VERSION=$(node -p "require('./package.json').version")
LAST_GIT_TAG=$(git describe --tags --abbrev=0)
if [ "v$PACKAGE_VERSION" == "$LAST_GIT_TAG" ]; then
echo "Package version ($PACKAGE_VERSION) has not been updated since the last tag ($LAST_GIT_TAG)."
exit 1
else
echo "Package version has been updated to $PACKAGE_VERSION."
fi
- name: Install dependencies
run: npm install && npm audit fix

- name: Build
run: npm run build

- name: Deploy
run: npm publish
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

- name: Execute script for milestone
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
VERSION_NAME: ${{ steps.check-version.outputs.package_version }}
run: node .github/scripts/manage-deploy.js $VERSION_NAME

14 changes: 14 additions & 0 deletions .github/workflows/issue-manager.yml
@@ -0,0 +1,14 @@
name: Issue Management Action

on:
schedule:
- cron: '0 0 * * *'

jobs:
manage-issues:
runs-on: ubuntu-latest
steps:
- name: Run script to manage issues
run: node .github/scripts/manage-issues.js
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
3 changes: 2 additions & 1 deletion .gitignore
Expand Up @@ -14,4 +14,5 @@ bower_components/**

#dev
.git/**
package-lock.json
package-lock.json
/.vs
2 changes: 2 additions & 0 deletions README.md
@@ -1,6 +1,7 @@
# SunEditor
Vanilla javascript based WYSIWYG web editor, with no dependencies.
SunEditor supports IE11 and all modern browsers with no dependencies and polyfill.
Coded based on ES5 in supported by IE11.

#### Demo : <a href="http://suneditor.com" target="_blank">suneditor.com</a>

Expand Down Expand Up @@ -390,6 +391,7 @@ plugins: [
// * {custom_plugin, ...plugins}

// Values
strictMode : Option to disable clean mode, which checks the styles, classes, etc. of the editor content. default : false {Boolean}
lang : language object. default : en {Object}
defaultTag : Specifies default tag name of the editor. default: 'p' {String}
textTags : You can change the tag of the default text button. default: { bold: 'STRONG', underline: 'U', italic: 'EM', strike: 'DEL' }
Expand Down
4 changes: 2 additions & 2 deletions dist/suneditor.min.js

Large diffs are not rendered by default.

5 changes: 3 additions & 2 deletions package.json
@@ -1,6 +1,6 @@
{
"name": "suneditor",
"version": "2.45.1",
"version": "2.46.0",
"description": "Vanilla javascript based WYSIWYG web editor, with no dependencies",
"author": "JiHong.Lee",
"license": "MIT",
Expand Down Expand Up @@ -30,12 +30,14 @@
],
"devDependencies": {
"@babel/core": "^7.21.3",
"@octokit/rest": "^20.1.0",
"@webpack-cli/init": "^0.2.2",
"babel-loader": "^8.1.0",
"clean-webpack-plugin": "^0.1.19",
"codemirror": "^5.61.0",
"css-loader": "^1.0.1",
"csstype": "^2.6.13",
"dotenv": "^16.4.5",
"file-loader": "^2.0.0",
"html-webpack-plugin": "^3.2.0",
"jasmine": "^2.99.0",
Expand All @@ -53,7 +55,6 @@
"webpack-dev-server": "^3.11.0",
"webpack-merge": "^4.2.2"
},
"dependencies": {},
"keywords": [
"wysiwyg",
"wysiwyg editor",
Expand Down
2 changes: 2 additions & 0 deletions sample/html/options.html
Expand Up @@ -68,6 +68,7 @@
<article class="markdown-body entry-content">
<div style="background-color: #f3f3f3; padding: 4px 20px 20px 20px;">
<h4 style="color: #b94a48;">--Value</h4>
<label><input type="checkbox" id="strictMode">&nbsp;&nbsp;strictMode&nbsp;&nbsp;&nbsp;</label><br><br>
<label><input type="checkbox" id="defaultTag">&nbsp;&nbsp;defaultTag&nbsp;&nbsp;&nbsp;</label>
<input type="text" id="defaultTag_value" placeholder="String ('p', 'div'..)"></input>
<br><br>
Expand Down Expand Up @@ -601,6 +602,7 @@ <h2 class="sub-title">Applied options</h2>
imageTable.innerHTML = '';

var options = {
strictMode: document.getElementById('strictMode').checked ? true : undefined,
defaultTag: document.getElementById('defaultTag').checked ? document.getElementById('defaultTag_value').value : undefined,
textTags: document.getElementById('textTags').checked ? {
bold: 'b',
Expand Down
5 changes: 5 additions & 0 deletions src/lang/fa.d.ts
@@ -0,0 +1,5 @@
import { Lang } from './Lang';

declare const fa: Lang;

export default fa;

0 comments on commit 7554d75

Please sign in to comment.