Skip to content

Commit 82b7a36

Browse files
committed
fix: configure dev server
1 parent 5156a33 commit 82b7a36

File tree

5 files changed

+143
-8
lines changed

5 files changed

+143
-8
lines changed

dev/index.html

+2-2
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@
99
<div id="editorjs"></div>
1010
<script src="https://cdn.jsdelivr.net/npm/@editorjs/editorjs@latest"></script>
1111
<script src="https://cdn.jsdelivr.net/npm/@editorjs/header@latest"></script>
12-
<script src="../dist/code.umd.js"></script>
13-
<script>
12+
<script type="module">
13+
import CodeTool from '../src/index.ts';
1414
const editor = new EditorJS({
1515
holder: 'editorjs',
1616
data: {

dev/server.js

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
const http = require('http');
2+
const SERVER_PORT = 8008;
3+
4+
class ServerExample {
5+
constructor({ port, fieldName }) {
6+
this.fieldName = fieldName;
7+
this.server = http.createServer().listen(port);
8+
9+
this.server.on('listening', () => {
10+
console.log('Server is listening ' + port + '...');
11+
});
12+
13+
this.server.on('error', (error) => {
14+
console.log('Failed to run server', error);
15+
});
16+
}
17+
}
18+
19+
new ServerExample({
20+
port: SERVER_PORT,
21+
});

package.json

+3-2
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
}
2525
},
2626
"scripts": {
27-
"dev": "vite",
27+
"dev": "concurrently \"vite\" \"node ./dev/server.js\"",
2828
"build": "vite build",
2929
"lint": "eslint",
3030
"lint:errors": "eslint --quiet",
@@ -47,6 +47,7 @@
4747
"vite-plugin-dts": "^3.9.1"
4848
},
4949
"dependencies": {
50-
"@codexteam/icons": "^0.3.2"
50+
"@codexteam/icons": "^0.3.2",
51+
"concurrently": "^9.1.0"
5152
}
5253
}

vite.config.js

+3
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,9 @@ export default {
1515
fileName: 'code',
1616
},
1717
},
18+
server: {
19+
open: './dev/index.html',
20+
},
1821
define: {
1922
NODE_ENV: JSON.stringify(NODE_ENV),
2023
VERSION: JSON.stringify(VERSION),

yarn.lock

+114-4
Original file line numberDiff line numberDiff line change
@@ -695,7 +695,7 @@ ansi-regex@^5.0.1:
695695
resolved "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz"
696696
integrity sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==
697697

698-
ansi-styles@^4.1.0:
698+
ansi-styles@^4.0.0, ansi-styles@^4.1.0:
699699
version "4.3.0"
700700
resolved "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz"
701701
integrity sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==
@@ -845,14 +845,23 @@ callsites@^3.0.0:
845845
resolved "https://registry.npmjs.org/callsites/-/callsites-3.1.0.tgz"
846846
integrity sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==
847847

848-
chalk@^4.0.0:
848+
chalk@^4.0.0, chalk@^4.1.2:
849849
version "4.1.2"
850850
resolved "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz"
851851
integrity sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==
852852
dependencies:
853853
ansi-styles "^4.1.0"
854854
supports-color "^7.1.0"
855855

856+
cliui@^8.0.1:
857+
version "8.0.1"
858+
resolved "https://registry.yarnpkg.com/cliui/-/cliui-8.0.1.tgz#0c04b075db02cbfe60dc8e6cf2f5486b1a3608aa"
859+
integrity sha512-BSeNnyus75C4//NQ9gQt1/csTXyo/8Sb+afLAkzAptFuMsod9HFokGNudZpi/oQV73hnVK+sR+5PVRMd+Dr7YQ==
860+
dependencies:
861+
string-width "^4.2.0"
862+
strip-ansi "^6.0.1"
863+
wrap-ansi "^7.0.0"
864+
856865
color-convert@^2.0.1:
857866
version "2.0.1"
858867
resolved "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz"
@@ -885,6 +894,19 @@ [email protected]:
885894
resolved "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz"
886895
integrity sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==
887896

897+
concurrently@^9.1.0:
898+
version "9.1.0"
899+
resolved "https://registry.yarnpkg.com/concurrently/-/concurrently-9.1.0.tgz#8da6d609f4321752912dab9be8710232ac496aa0"
900+
integrity sha512-VxkzwMAn4LP7WyMnJNbHN5mKV9L2IbyDjpzemKr99sXNR3GqRNMMHdm7prV1ws9wg7ETj6WUkNOigZVsptwbgg==
901+
dependencies:
902+
chalk "^4.1.2"
903+
lodash "^4.17.21"
904+
rxjs "^7.8.1"
905+
shell-quote "^1.8.1"
906+
supports-color "^8.1.1"
907+
tree-kill "^1.2.2"
908+
yargs "^17.7.2"
909+
888910
cross-spawn@^7.0.2:
889911
version "7.0.3"
890912
resolved "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz"
@@ -989,6 +1011,11 @@ doctrine@^2.1.0:
9891011
dependencies:
9901012
esutils "^2.0.2"
9911013

1014+
emoji-regex@^8.0.0:
1015+
version "8.0.0"
1016+
resolved "https://registry.yarnpkg.com/emoji-regex/-/emoji-regex-8.0.0.tgz#e818fd69ce5ccfcb404594f842963bf53164cc37"
1017+
integrity sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==
1018+
9921019
enhanced-resolve@^5.17.0:
9931020
version "5.17.1"
9941021
resolved "https://registry.yarnpkg.com/enhanced-resolve/-/enhanced-resolve-5.17.1.tgz#67bfbbcc2f81d511be77d686a90267ef7f898a15"
@@ -1132,6 +1159,11 @@ esbuild@^0.21.3:
11321159
"@esbuild/win32-ia32" "0.21.5"
11331160
"@esbuild/win32-x64" "0.21.5"
11341161

1162+
escalade@^3.1.1:
1163+
version "3.2.0"
1164+
resolved "https://registry.yarnpkg.com/escalade/-/escalade-3.2.0.tgz#011a3f69856ba189dffa7dc8fcce99d2a87903e5"
1165+
integrity sha512-WUj2qlxaQtO4g6Pq5c29GTcWGDyd8itL8zTlipgECz3JesAiiOKotd8JU6otB3PACgG6xkJUyVhboMS+bje/jA==
1166+
11351167
escape-string-regexp@^4.0.0:
11361168
version "4.0.0"
11371169
resolved "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz"
@@ -1515,6 +1547,11 @@ functions-have-names@^1.2.3:
15151547
resolved "https://registry.yarnpkg.com/functions-have-names/-/functions-have-names-1.2.3.tgz#0404fe4ee2ba2f607f0e0ec3c80bae994133b834"
15161548
integrity sha512-xckBUXyTIqT97tq2x2AMb+g163b5JFysYk0x4qxNFwbfQkmNZoiRHb6sPzI9/QV33WeuvVYBUIiD4NzNIyqaRQ==
15171549

1550+
get-caller-file@^2.0.5:
1551+
version "2.0.5"
1552+
resolved "https://registry.yarnpkg.com/get-caller-file/-/get-caller-file-2.0.5.tgz#4f94412a82db32f36e3b0b9741f8a97feb031f7e"
1553+
integrity sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==
1554+
15181555
get-intrinsic@^1.1.3, get-intrinsic@^1.2.1, get-intrinsic@^1.2.3, get-intrinsic@^1.2.4:
15191556
version "1.2.4"
15201557
resolved "https://registry.yarnpkg.com/get-intrinsic/-/get-intrinsic-1.2.4.tgz#e385f5a4b5227d449c3eabbad05494ef0abbeadd"
@@ -1754,6 +1791,11 @@ is-extglob@^2.1.1:
17541791
resolved "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz"
17551792
integrity sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==
17561793

1794+
is-fullwidth-code-point@^3.0.0:
1795+
version "3.0.0"
1796+
resolved "https://registry.yarnpkg.com/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz#f116f8064fe90b3f7844a38997c0b75051269f1d"
1797+
integrity sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==
1798+
17571799
is-glob@^4.0.0, is-glob@^4.0.1, is-glob@^4.0.3:
17581800
version "4.0.3"
17591801
resolved "https://registry.npmjs.org/is-glob/-/is-glob-4.0.3.tgz"
@@ -2207,6 +2249,11 @@ regexp.prototype.flags@^1.5.2:
22072249
es-errors "^1.3.0"
22082250
set-function-name "^2.0.1"
22092251

2252+
require-directory@^2.1.1:
2253+
version "2.1.1"
2254+
resolved "https://registry.yarnpkg.com/require-directory/-/require-directory-2.1.1.tgz#8c64ad5fd30dab1c976e2344ffe7f792a6a6df42"
2255+
integrity sha512-fGxEI7+wsG9xrvdjsrlmL22OMTTiHRwAMroiEeMgq8gzoLC/PQr7RsRDSTLUg/bZAZtF+TVIkHc6/4RIKrui+Q==
2256+
22102257
resolve-from@^4.0.0:
22112258
version "4.0.0"
22122259
resolved "https://registry.npmjs.org/resolve-from/-/resolve-from-4.0.0.tgz"
@@ -2271,6 +2318,13 @@ run-parallel@^1.1.9:
22712318
dependencies:
22722319
queue-microtask "^1.2.2"
22732320

2321+
rxjs@^7.8.1:
2322+
version "7.8.1"
2323+
resolved "https://registry.yarnpkg.com/rxjs/-/rxjs-7.8.1.tgz#6f6f3d99ea8044291efd92e7c7fcf562c4057543"
2324+
integrity sha512-AA3TVj+0A2iuIoQkWEK/tqFjBq2j+6PO6Y0zJcvzLAFhEFIO3HL0vls9hWLncZbAAbK0mar7oZ4V079I/qPMxg==
2325+
dependencies:
2326+
tslib "^2.1.0"
2327+
22742328
safe-array-concat@^1.1.2:
22752329
version "1.1.2"
22762330
resolved "https://registry.yarnpkg.com/safe-array-concat/-/safe-array-concat-1.1.2.tgz#81d77ee0c4e8b863635227c721278dd524c20edb"
@@ -2346,6 +2400,11 @@ shebang-regex@^3.0.0:
23462400
resolved "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz"
23472401
integrity sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==
23482402

2403+
shell-quote@^1.8.1:
2404+
version "1.8.1"
2405+
resolved "https://registry.yarnpkg.com/shell-quote/-/shell-quote-1.8.1.tgz#6dbf4db75515ad5bac63b4f1894c3a154c766680"
2406+
integrity sha512-6j1W9l1iAs/4xYBI1SYOVZyFcCis9b4KCLQ8fgAGG07QvzaRLVVRQvAy85yNmmZSjYjg4MWh4gNvlPujU/5LpA==
2407+
23492408
side-channel@^1.0.4:
23502409
version "1.0.6"
23512410
resolved "https://registry.yarnpkg.com/side-channel/-/side-channel-1.0.6.tgz#abd25fb7cd24baf45466406b1096b7831c9215f2"
@@ -2404,6 +2463,15 @@ string-argv@~0.3.1:
24042463
resolved "https://registry.npmjs.org/string-argv/-/string-argv-0.3.2.tgz"
24052464
integrity sha512-aqD2Q0144Z+/RqG52NeHEkZauTAUWJO8c6yTftGJKO3Tja5tUgIfmIl6kExvhtxSDP7fXB6DvzkfMpCd/F3G+Q==
24062465

2466+
string-width@^4.1.0, string-width@^4.2.0, string-width@^4.2.3:
2467+
version "4.2.3"
2468+
resolved "https://registry.yarnpkg.com/string-width/-/string-width-4.2.3.tgz#269c7117d27b05ad2e536830a8ec895ef9c6d010"
2469+
integrity sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==
2470+
dependencies:
2471+
emoji-regex "^8.0.0"
2472+
is-fullwidth-code-point "^3.0.0"
2473+
strip-ansi "^6.0.1"
2474+
24072475
string.prototype.trim@^1.2.9:
24082476
version "1.2.9"
24092477
resolved "https://registry.yarnpkg.com/string.prototype.trim/-/string.prototype.trim-1.2.9.tgz#b6fa326d72d2c78b6df02f7759c73f8f6274faa4"
@@ -2432,7 +2500,7 @@ string.prototype.trimstart@^1.0.8:
24322500
define-properties "^1.2.1"
24332501
es-object-atoms "^1.0.0"
24342502

2435-
strip-ansi@^6.0.1:
2503+
strip-ansi@^6.0.0, strip-ansi@^6.0.1:
24362504
version "6.0.1"
24372505
resolved "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz"
24382506
integrity sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==
@@ -2456,7 +2524,7 @@ supports-color@^7.1.0:
24562524
dependencies:
24572525
has-flag "^4.0.0"
24582526

2459-
supports-color@~8.1.1:
2527+
supports-color@^8.1.1, supports-color@~8.1.1:
24602528
version "8.1.1"
24612529
resolved "https://registry.npmjs.org/supports-color/-/supports-color-8.1.1.tgz"
24622530
integrity sha512-MpUEN2OodtUzxvKQl72cUF7RQ5EiHsGvSsVG0ia9c5RbWGL2CI4C7EpPS8UTBIplnlzZiNuV56w+FuNxy3ty2Q==
@@ -2493,6 +2561,11 @@ to-regex-range@^5.0.1:
24932561
dependencies:
24942562
is-number "^7.0.0"
24952563

2564+
tree-kill@^1.2.2:
2565+
version "1.2.2"
2566+
resolved "https://registry.yarnpkg.com/tree-kill/-/tree-kill-1.2.2.tgz#4ca09a9092c88b73a7cdc5e8a01b507b0790a0cc"
2567+
integrity sha512-L0Orpi8qGpRG//Nd+H90vFB+3iHnue1zSSGmNOOCh1GLJ7rUKVwV2HvijphGQS2UmhUZewS9VgvxYIdgr+fG1A==
2568+
24962569
ts-api-utils@^1.0.1, ts-api-utils@^1.3.0:
24972570
version "1.3.0"
24982571
resolved "https://registry.npmjs.org/ts-api-utils/-/ts-api-utils-1.3.0.tgz"
@@ -2508,6 +2581,11 @@ tsconfig-paths@^3.15.0:
25082581
minimist "^1.2.6"
25092582
strip-bom "^3.0.0"
25102583

2584+
tslib@^2.1.0:
2585+
version "2.8.1"
2586+
resolved "https://registry.yarnpkg.com/tslib/-/tslib-2.8.1.tgz#612efe4ed235d567e8aba5f2a5fab70280ade83f"
2587+
integrity sha512-oJFu94HQb+KVduSUQL7wnpmqnfmLsOA/nAh6b6EH0wCEoK0/mPeXU6c3wKDV83MkOuHPRHtSXKKU99IBazS/2w==
2588+
25112589
tslib@^2.6.2:
25122590
version "2.7.0"
25132591
resolved "https://registry.yarnpkg.com/tslib/-/tslib-2.7.0.tgz#d9b40c5c40ab59e8738f297df3087bf1a2690c01"
@@ -2713,16 +2791,48 @@ word-wrap@^1.2.5:
27132791
resolved "https://registry.npmjs.org/word-wrap/-/word-wrap-1.2.5.tgz"
27142792
integrity sha512-BN22B5eaMMI9UMtjrGd5g5eCYPpCPDUy0FJXbYsaT5zYxjFOckS53SQDE3pWkVoWpHXVb3BrYcEN4Twa55B5cA==
27152793

2794+
wrap-ansi@^7.0.0:
2795+
version "7.0.0"
2796+
resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-7.0.0.tgz#67e145cff510a6a6984bdf1152911d69d2eb9e43"
2797+
integrity sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==
2798+
dependencies:
2799+
ansi-styles "^4.0.0"
2800+
string-width "^4.1.0"
2801+
strip-ansi "^6.0.0"
2802+
27162803
xml-name-validator@^4.0.0:
27172804
version "4.0.0"
27182805
resolved "https://registry.yarnpkg.com/xml-name-validator/-/xml-name-validator-4.0.0.tgz#79a006e2e63149a8600f15430f0a4725d1524835"
27192806
integrity sha512-ICP2e+jsHvAj2E2lIHxa5tjXRlKDJo4IdvPvCXbXQGdzSfmSpNVyIKMvoZHjDY9DP0zV17iI85o90vRFXNccRw==
27202807

2808+
y18n@^5.0.5:
2809+
version "5.0.8"
2810+
resolved "https://registry.yarnpkg.com/y18n/-/y18n-5.0.8.tgz#7f4934d0f7ca8c56f95314939ddcd2dd91ce1d55"
2811+
integrity sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA==
2812+
27212813
yallist@^4.0.0:
27222814
version "4.0.0"
27232815
resolved "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz"
27242816
integrity sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==
27252817

2818+
yargs-parser@^21.1.1:
2819+
version "21.1.1"
2820+
resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-21.1.1.tgz#9096bceebf990d21bb31fa9516e0ede294a77d35"
2821+
integrity sha512-tVpsJW7DdjecAiFpbIB1e3qxIQsE6NoPc5/eTdrbbIC4h0LVsWhnoa3g+m2HclBIujHzsxZ4VJVA+GUuc2/LBw==
2822+
2823+
yargs@^17.7.2:
2824+
version "17.7.2"
2825+
resolved "https://registry.yarnpkg.com/yargs/-/yargs-17.7.2.tgz#991df39aca675a192b816e1e0363f9d75d2aa269"
2826+
integrity sha512-7dSzzRQ++CKnNI/krKnYRV7JKKPUXMEh61soaHKg9mrWEhzFWhFnxPxGl+69cD1Ou63C13NUPCnmIcrvqCuM6w==
2827+
dependencies:
2828+
cliui "^8.0.1"
2829+
escalade "^3.1.1"
2830+
get-caller-file "^2.0.5"
2831+
require-directory "^2.1.1"
2832+
string-width "^4.2.3"
2833+
y18n "^5.0.5"
2834+
yargs-parser "^21.1.1"
2835+
27262836
yocto-queue@^0.1.0:
27272837
version "0.1.0"
27282838
resolved "https://registry.yarnpkg.com/yocto-queue/-/yocto-queue-0.1.0.tgz#0294eb3dee05028d31ee1a5fa2c556a6aaf10a1b"

0 commit comments

Comments
 (0)