Skip to content

Commit

Permalink
Move Quill source code into src
Browse files Browse the repository at this point in the history
  • Loading branch information
luin committed Nov 26, 2023
1 parent c380874 commit 0e74eed
Show file tree
Hide file tree
Showing 197 changed files with 3,271 additions and 23,265 deletions.
25,870 changes: 2,970 additions & 22,900 deletions package-lock.json

Large diffs are not rendered by default.

5 changes: 4 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,5 +49,8 @@
"engines": {
"npm": ">=8.2.3"
},
"engineStrict": true
"engineStrict": true,
"devDependencies": {
"typescript": "^5.2.2"
}
}
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
module.exports = {
export default {
presets: ['@babel/preset-env', '@babel/preset-typescript'],
};
26 changes: 1 addition & 25 deletions packages/quill/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

26 changes: 16 additions & 10 deletions packages/quill/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,23 +18,26 @@
"quill-delta": "^5.1.0"
},
"devDependencies": {
"@babel/core": "^7.22.5",
"@babel/preset-env": "^7.22.5",
"@babel/preset-typescript": "^7.22.5",
"@babel/cli": "^7.23.4",
"@babel/core": "^7.23.3",
"@babel/preset-env": "^7.23.3",
"@babel/preset-typescript": "^7.23.3",
"@playwright/test": "^1.39.0",
"@types/lodash-es": "^4.17.11",
"@typescript-eslint/eslint-plugin": "^6.9.1",
"@typescript-eslint/parser": "^6.9.1",
"@types/lodash-es": "^4.17.12",
"@types/node": "^20.10.0",
"@types/webpack": "^5.28.5",
"@typescript-eslint/eslint-plugin": "^6.12.0",
"@typescript-eslint/parser": "^6.12.0",
"@vitest/browser": "^1.0.0-beta.5",
"babel-loader": "^9.1.2",
"babel-plugin-istanbul": "^6.1.1",
"babel-loader": "^9.1.3",
"css-loader": "^6.8.1",
"eslint": "^8.54.0",
"eslint-config-prettier": "^9.0.0",
"eslint-import-resolver-webpack": "^0.13.8",
"eslint-plugin-import": "^2.29.0",
"eslint-plugin-jsx-a11y": "^6.8.0",
"eslint-plugin-prettier": "^5.0.1",
"glob": "^10.3.10",
"highlight.js": "^9.18.1",
"html-loader": "^4.2.0",
"html-webpack-plugin": "^5.5.3",
Expand All @@ -48,7 +51,9 @@
"style-loader": "^3.3.3",
"stylus": "^0.62.0",
"stylus-loader": "^7.1.3",
"ts-loader": "^9.5.0",
"terser-webpack-plugin": "^5.3.9",
"transpile-webpack-plugin": "^1.1.3",
"ts-loader": "^9.5.1",
"ts-node": "^10.9.1",
"typescript": "^5.2.2",
"vitest": "^1.0.0-beta.5",
Expand All @@ -72,7 +77,8 @@
"defaults"
],
"scripts": {
"build": "npm run build:webpack",
"build:dev": "./scripts/build development",
"build:prod": "./scripts/build production",
"build:webpack": "webpack",
"build:release": "./_develop/scripts/release.sh",
"develop": "npm run start",
Expand Down
8 changes: 4 additions & 4 deletions packages/quill/playwright.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { devices } from '@playwright/test';
const port = 9001;

export default defineConfig({
testDir: './e2e',
testDir: './test/e2e',
testMatch: '*.spec.ts',
timeout: 30 * 1000,
expect: {
Expand All @@ -23,11 +23,11 @@ export default defineConfig({
},
projects: [
{ name: 'Chrome', use: { ...devices['Desktop Chrome'] } },
// { name: 'Firefox', use: { ...devices['Desktop Firefox'] } },
// { name: 'Safari', use: { ...devices['Desktop Safari'] } },
{ name: 'Firefox', use: { ...devices['Desktop Firefox'] } },
{ name: 'Safari', use: { ...devices['Desktop Safari'] } },
],
webServer: {
command: `npx webpack serve --config e2e/__dev_server__/webpack.config.js --env port=${port}`,
command: `npx webpack serve --config test/e2e/__dev_server__/webpack.config.js --env port=${port}`,
port,
ignoreHTTPSErrors: true,
reuseExistingServer: !process.env.CI,
Expand Down
27 changes: 0 additions & 27 deletions packages/quill/rm.sh

This file was deleted.

7 changes: 0 additions & 7 deletions packages/quill/rmmap.sh

This file was deleted.

9 changes: 9 additions & 0 deletions packages/quill/scripts/build
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#!/usr/bin/env bash

set -e

DIST=dist

rm -rf $DIST
npx babel src --out-dir $DIST --copy-files --no-copy-ignored --extensions .ts
npx webpack -- --mode $1
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
const path = require('path');
const HtmlWebpackPlugin = require('html-webpack-plugin');
const { ...common } = require('../../webpack.common');
const { merge } = require('webpack-merge');
import path from 'path';
import HtmlWebpackPlugin from 'html-webpack-plugin';
import common from '../../../webpack.common';
import { merge } from 'webpack-merge';
import type { Configuration } from 'webpack';

module.exports = (env) =>
merge(common, {
export default (env: Record<string, unknown>) =>
merge<Configuration>(common, {
plugins: [
new HtmlWebpackPlugin({
publicPath: '/',
Expand All @@ -16,7 +17,7 @@ module.exports = (env) =>
}),
],
devServer: {
port: env.port,
port: env.port as string,
server: 'https',
hot: false,
liveReload: false,
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
8 changes: 4 additions & 4 deletions packages/quill/test/fuzz/editor.spec.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import type { Op } from 'quill-delta';
import Delta, { AttributeMap } from 'quill-delta';
import { choose, randomInt, runFuzz } from './__helpers__/utils';
import { AlignClass } from '../../formats/align';
import { FontClass } from '../../formats/font';
import { SizeClass } from '../../formats/size';
import Quill from '../../quill';
import { AlignClass } from '../../src/formats/align';
import { FontClass } from '../../src/formats/font';
import { SizeClass } from '../../src/formats/size';
import Quill from '../../src/quill';
import { describe, expect, test } from 'vitest';

type AttributeDef = { name: string; values: (number | string | boolean)[] };
Expand Down
4 changes: 2 additions & 2 deletions packages/quill/test/fuzz/tableEmbed.spec.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import type { AttributeMap } from 'quill-delta';
import Delta from 'quill-delta';
import TableEmbed from '../../modules/tableEmbed';
import TableEmbed from '../../src/modules/tableEmbed';
import type {
CellData,
TableData,
TableRowColumnOp,
} from '../../modules/tableEmbed';
} from '../../src/modules/tableEmbed';
import { choose, randomInt } from './__helpers__/utils';
import { beforeAll, describe, expect, test } from 'vitest';

Expand Down
16 changes: 8 additions & 8 deletions packages/quill/test/unit/__helpers__/factory.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
import { Registry } from 'parchment';

import Block from '../../../blots/block';
import Break from '../../../blots/break';
import Cursor from '../../../blots/cursor';
import Scroll from '../../../blots/scroll';
import TextBlot from '../../../blots/text';
import ListItem, { ListContainer } from '../../../formats/list';
import Inline from '../../../blots/inline';
import Emitter from '../../../core/emitter';
import Block from '../../../src/blots/block';
import Break from '../../../src/blots/break';
import Cursor from '../../../src/blots/cursor';
import Scroll from '../../../src/blots/scroll';
import TextBlot from '../../../src/blots/text';
import ListItem, { ListContainer } from '../../../src/formats/list';
import Inline from '../../../src/blots/inline';
import Emitter from '../../../src/core/emitter';
import { normalizeHTML } from './utils';

export const createRegistry = (formats: unknown[] = []) => {
Expand Down
4 changes: 2 additions & 2 deletions packages/quill/test/unit/blots/block-embed.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ import {
createScroll as baseCreateScroll,
createRegistry,
} from '../__helpers__/factory';
import Video from '../../../formats/video';
import Image from '../../../formats/image';
import Video from '../../../src/formats/video';
import Image from '../../../src/formats/image';

const createScroll = (html: string) =>
baseCreateScroll(html, createRegistry([Video, Image]));
Expand Down
4 changes: 2 additions & 2 deletions packages/quill/test/unit/blots/block.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ import {
createScroll as baseCreateScroll,
createRegistry,
} from '../__helpers__/factory';
import Header from '../../../formats/header';
import Bold from '../../../formats/bold';
import Header from '../../../src/formats/header';
import Bold from '../../../src/formats/bold';

const createScroll = (html: string) =>
baseCreateScroll(html, createRegistry([Header, Bold]));
Expand Down
4 changes: 2 additions & 2 deletions packages/quill/test/unit/blots/inline.spec.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { describe, expect, test } from 'vitest';
import { createRegistry, createScroll } from '../__helpers__/factory';
import Bold from '../../../formats/bold';
import Italic from '../../../formats/italic';
import Bold from '../../../src/formats/bold';
import Italic from '../../../src/formats/italic';

describe('Inline', () => {
test('format order', () => {
Expand Down
12 changes: 6 additions & 6 deletions packages/quill/test/unit/blots/scroll.spec.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
import { describe, expect, test, vitest } from 'vitest';
import Emitter from '../../../core/emitter';
import Selection, { Range } from '../../../core/selection';
import Cursor from '../../../blots/cursor';
import Scroll from '../../../blots/scroll';
import Emitter from '../../../src/core/emitter';
import Selection, { Range } from '../../../src/core/selection';
import Cursor from '../../../src/blots/cursor';
import Scroll from '../../../src/blots/scroll';
import Delta from 'quill-delta';
import { createRegistry } from '../__helpers__/factory';
import { normalizeHTML, sleep } from '../__helpers__/utils';
import Underline from '../../../formats/underline';
import Strike from '../../../formats/strike';
import Underline from '../../../src/formats/underline';
import Strike from '../../../src/formats/strike';

const createScroll = (html: string) => {
const emitter = new Emitter();
Expand Down
8 changes: 4 additions & 4 deletions packages/quill/test/unit/core/composition.spec.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import Emitter from '../../../core/emitter';
import Composition from '../../../core/composition';
import Scroll from '../../../blots/scroll';
import Emitter from '../../../src/core/emitter';
import Composition from '../../../src/core/composition';
import Scroll from '../../../src/blots/scroll';
import { describe, expect, test, vitest } from 'vitest';
import { createRegistry } from '../__helpers__/factory';
import Quill from '../../../core';
import Quill from '../../../src/core';

describe('Composition', function () {
test('triggers events on compositionstart', async () => {
Expand Down
46 changes: 23 additions & 23 deletions packages/quill/test/unit/core/editor.spec.ts
Original file line number Diff line number Diff line change
@@ -1,30 +1,30 @@
import Delta from 'quill-delta';
import Editor from '../../../core/editor';
import Block from '../../../blots/block';
import Selection, { Range } from '../../../core/selection';
import Scroll from '../../../blots/scroll';
import Editor from '../../../src/core/editor';
import Block from '../../../src/blots/block';
import Selection, { Range } from '../../../src/core/selection';
import Scroll from '../../../src/blots/scroll';
import { Registry } from 'parchment';
import Text from '../../../blots/text';
import Emitter from '../../../core/emitter';
import Break from '../../../blots/break';
import Text from '../../../src/blots/text';
import Emitter from '../../../src/core/emitter';
import Break from '../../../src/blots/break';
import { describe, expect, test } from 'vitest';
import { createRegistry, createScroll } from '../__helpers__/factory';
import List, { ListContainer } from '../../../formats/list';
import Bold from '../../../formats/bold';
import Image from '../../../formats/image';
import Link from '../../../formats/link';
import { FontClass } from '../../../formats/font';
import Header from '../../../formats/header';
import Italic from '../../../formats/italic';
import { AlignClass } from '../../../formats/align';
import Video from '../../../formats/video';
import Strike from '../../../formats/strike';
import Underline from '../../../formats/underline';
import CodeBlock, { CodeBlockContainer } from '../../../formats/code';
import { SizeClass } from '../../../formats/size';
import Blockquote from '../../../formats/blockquote';
import IndentClass from '../../../formats/indent';
import { ColorClass } from '../../../formats/color';
import List, { ListContainer } from '../../../src/formats/list';
import Bold from '../../../src/formats/bold';
import Image from '../../../src/formats/image';
import Link from '../../../src/formats/link';
import { FontClass } from '../../../src/formats/font';
import Header from '../../../src/formats/header';
import Italic from '../../../src/formats/italic';
import { AlignClass } from '../../../src/formats/align';
import Video from '../../../src/formats/video';
import Strike from '../../../src/formats/strike';
import Underline from '../../../src/formats/underline';
import CodeBlock, { CodeBlockContainer } from '../../../src/formats/code';
import { SizeClass } from '../../../src/formats/size';
import Blockquote from '../../../src/formats/blockquote';
import IndentClass from '../../../src/formats/indent';
import { ColorClass } from '../../../src/formats/color';

const createEditor = (html: string | { html: string }) => {
const scroll = createScroll(
Expand Down
Loading

0 comments on commit 0e74eed

Please sign in to comment.