From dfbce1decff578d30e381541608f075cc8dc7eee Mon Sep 17 00:00:00 2001 From: Peter Savchenko Date: Tue, 7 Jan 2025 19:05:23 +0300 Subject: [PATCH 1/3] rm all submodules --- .gitmodules | 45 ---- example/example-dev.html | 422 -------------------------------- example/example-rtl.html | 30 +-- example/tools/code | 1 - example/tools/delimiter | 1 - example/tools/embed | 1 - example/tools/header | 1 - example/tools/image | 1 - example/tools/inline-code | 1 - example/tools/link | 1 - example/tools/list | 1 - example/tools/marker | 1 - example/tools/quote | 1 - example/tools/raw | 1 - example/tools/simple-image | 1 - example/tools/table | 1 - example/tools/text-variant-tune | 1 - example/tools/warning | 1 - 18 files changed, 15 insertions(+), 497 deletions(-) delete mode 100644 example/example-dev.html delete mode 160000 example/tools/code delete mode 160000 example/tools/delimiter delete mode 160000 example/tools/embed delete mode 160000 example/tools/header delete mode 160000 example/tools/image delete mode 160000 example/tools/inline-code delete mode 160000 example/tools/link delete mode 160000 example/tools/list delete mode 160000 example/tools/marker delete mode 160000 example/tools/quote delete mode 160000 example/tools/raw delete mode 160000 example/tools/simple-image delete mode 160000 example/tools/table delete mode 160000 example/tools/text-variant-tune delete mode 160000 example/tools/warning diff --git a/.gitmodules b/.gitmodules index 44e1a2ff4..69841340f 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,48 +1,3 @@ -[submodule "example/tools/inline-code"] - path = example/tools/inline-code - url = https://github.com/editor-js/inline-code -[submodule "example/tools/header"] - path = example/tools/header - url = https://github.com/editor-js/header -[submodule "example/tools/delimiter"] - path = example/tools/delimiter - url = https://github.com/editor-js/delimiter -[submodule "example/tools/quote"] - path = example/tools/quote - url = https://github.com/editor-js/quote -[submodule "example/tools/simple-image"] - path = example/tools/simple-image - url = https://github.com/editor-js/simple-image -[submodule "example/tools/marker"] - path = example/tools/marker - url = https://github.com/editor-js/marker -[submodule "example/tools/code"] - path = example/tools/code - url = https://github.com/editor-js/code -[submodule "example/tools/image"] - path = example/tools/image - url = https://github.com/editor-js/image -[submodule "example/tools/embed"] - path = example/tools/embed - url = https://github.com/editor-js/embed -[submodule "example/tools/table"] - path = example/tools/table - url = https://github.com/editor-js/table -[submodule "example/tools/link"] - path = example/tools/link - url = https://github.com/editor-js/link -[submodule "example/tools/raw"] - path = example/tools/raw - url = https://github.com/editor-js/raw -[submodule "example/tools/warning"] - path = example/tools/warning - url = https://github.com/editor-js/warning [submodule "example/tools/underline"] path = example/tools/underline url = https://github.com/editor-js/underline -[submodule "example/tools/text-variant-tune"] - path = example/tools/text-variant-tune - url = https://github.com/editor-js/text-variant-tune -[submodule "example/tools/list"] - path = example/tools/list - url = https://github.com/editor-js/list diff --git a/example/example-dev.html b/example/example-dev.html deleted file mode 100644 index 05d713175..000000000 --- a/example/example-dev.html +++ /dev/null @@ -1,422 +0,0 @@ - - - - - - Editor.js 🤩🧦🤨 example - - - - - - - -
- -
-
-
- No core bundle file found. Run yarn build -
-
- No submodules found. Run yarn pull_tools && yarn tools:update -
-
- editor.save() -
-
-
- Readonly: - - Off - -   -
- toggle -
-
-
-
- Show - blocks boundaries -
-
-
-
- Enable - thin mode -
-
-
-
-
-
-
-
-
-

-
-      
-    
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/example/example-rtl.html b/example/example-rtl.html index abeab23b4..1a3473166 100644 --- a/example/example-rtl.html +++ b/example/example-rtl.html @@ -53,21 +53,21 @@ Read more in Tool's README file. For example: https://github.com/editor-js/header#installation --> - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + diff --git a/example/tools/code b/example/tools/code deleted file mode 160000 index 82402cb86..000000000 --- a/example/tools/code +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 82402cb86a327e3c64bef653d953533e2c3613dd diff --git a/example/tools/delimiter b/example/tools/delimiter deleted file mode 160000 index 95a5eb90d..000000000 --- a/example/tools/delimiter +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 95a5eb90dd2e2e8ab153eb66b59a70cdafdf2d7f diff --git a/example/tools/embed b/example/tools/embed deleted file mode 160000 index 801580fbd..000000000 --- a/example/tools/embed +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 801580fbdb7ab0ad1e975cfdaab38ada6625e301 diff --git a/example/tools/header b/example/tools/header deleted file mode 160000 index 3e457cbac..000000000 --- a/example/tools/header +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 3e457cbac2c5da53fff1b02b99ddaccaa577f401 diff --git a/example/tools/image b/example/tools/image deleted file mode 160000 index c8236e576..000000000 --- a/example/tools/image +++ /dev/null @@ -1 +0,0 @@ -Subproject commit c8236e5765294f6b6590573910a68d3826671838 diff --git a/example/tools/inline-code b/example/tools/inline-code deleted file mode 160000 index 31a086d7d..000000000 --- a/example/tools/inline-code +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 31a086d7dc97169de34b9c191735cba7d63562d6 diff --git a/example/tools/link b/example/tools/link deleted file mode 160000 index aaa69d540..000000000 --- a/example/tools/link +++ /dev/null @@ -1 +0,0 @@ -Subproject commit aaa69d5408bad34027d6252a3892d40f9fa121be diff --git a/example/tools/list b/example/tools/list deleted file mode 160000 index bbc46d557..000000000 --- a/example/tools/list +++ /dev/null @@ -1 +0,0 @@ -Subproject commit bbc46d557bb5711dd27517272ae2754e1da04697 diff --git a/example/tools/marker b/example/tools/marker deleted file mode 160000 index 8d6897fca..000000000 --- a/example/tools/marker +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 8d6897fca43e387bcdf4a681380be975fe8f2a07 diff --git a/example/tools/quote b/example/tools/quote deleted file mode 160000 index 78f70cf23..000000000 --- a/example/tools/quote +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 78f70cf2391cc8aaf2d2e59615de3ad833d180c3 diff --git a/example/tools/raw b/example/tools/raw deleted file mode 160000 index 84b7d56b2..000000000 --- a/example/tools/raw +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 84b7d56b26a66d121edb6682ca205bf995d39034 diff --git a/example/tools/simple-image b/example/tools/simple-image deleted file mode 160000 index 963883520..000000000 --- a/example/tools/simple-image +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 963883520c7bbe5040366335c9a37bbdc7cf60fd diff --git a/example/tools/table b/example/tools/table deleted file mode 160000 index 5a57621c4..000000000 --- a/example/tools/table +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 5a57621c4e1abb884fd03e70862cb05b10bfe405 diff --git a/example/tools/text-variant-tune b/example/tools/text-variant-tune deleted file mode 160000 index 7f51a16d4..000000000 --- a/example/tools/text-variant-tune +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 7f51a16d4ab46eff9364f09cea52e09518896d2a diff --git a/example/tools/warning b/example/tools/warning deleted file mode 160000 index 0f3ec98b9..000000000 --- a/example/tools/warning +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 0f3ec98b9a3b0ea8a9a71cffcb4e596e5c98aecb From bf2b5daf1769b8790a3a2399144bccd7622b34fc Mon Sep 17 00:00:00 2001 From: Peter Savchenko Date: Tue, 7 Jan 2025 19:20:06 +0300 Subject: [PATCH 2/3] rm commands --- .gitmodules | 3 -- devserver.js | 128 ---------------------------------------------- docs/CHANGELOG.md | 1 + package.json | 7 --- 4 files changed, 1 insertion(+), 138 deletions(-) delete mode 100644 .gitmodules delete mode 100644 devserver.js diff --git a/.gitmodules b/.gitmodules deleted file mode 100644 index 69841340f..000000000 --- a/.gitmodules +++ /dev/null @@ -1,3 +0,0 @@ -[submodule "example/tools/underline"] - path = example/tools/underline - url = https://github.com/editor-js/underline diff --git a/devserver.js b/devserver.js deleted file mode 100644 index 5087a7b47..000000000 --- a/devserver.js +++ /dev/null @@ -1,128 +0,0 @@ -/** - * Server for testing example page on mobile devices. - * - * Usage: - * 1. run `yarn devserver:start` - * 2. Open `http://{ip_address}:3000/example/example-dev.html` - * where {ip_address} is IP of your machine. - * - * Also, can serve static files from `/example` or `/dist` on any device in local network. - */ -const path = require('path'); -const fs = require('fs'); -const http = require('http'); -const { networkInterfaces } = require('os'); - -const port = 3000; -const localhost = '127.0.0.1'; -const nonRoutableAddress = '0.0.0.0'; -const host = getHost(); -const server = http.createServer(serveStatic([ - '/example', - '/dist', -])); - -server.listen(port, nonRoutableAddress, () => { - console.log(` - -${wrapInColor('Editor.js 💖', consoleColors.hiColor)} devserver is running ᕕ(⌐■_■)ᕗ ✨ ---------------------------------------------- -${wrapInColor('http://' + host + ':' + port + '/example/example-dev.html', consoleColors.fgGreen)} ---------------------------------------------- -Page can be opened from any device connected to the same local network. -`); - - if (host === localhost) { - console.log(wrapInColor('Looks like you are not connected to any Network so you couldn\'t debug the Editor on your mobile device at the moment.', consoleColors.fgRed)); - } -}); - -/** - * Serves files from specified directories - * - * @param {string[]} paths - directories files from which should be served - * @returns {Function} - */ -function serveStatic(paths) { - return (request, response) => { - const resource = request.url; - const isPathAllowed = paths.find(p => resource.startsWith(p)); - - if (!isPathAllowed) { - response.writeHead(404); - response.end(); - - return; - } - const filePath = path.join(__dirname, resource); - - try { - const stat = fs.statSync(filePath); - - response.writeHead(200, { - 'Content-Length': stat.size, - }); - const readStream = fs.createReadStream(filePath); - - readStream.on('error', e => { - throw e; - }); - readStream.pipe(response); - } catch (e) { - response.writeHead(500); - response.end(e.toString()); - } - }; -} - -/** - * Returns IP address of a machine - * - * @returns {string} - */ -function getHost() { - const nets = networkInterfaces(); - const results = {}; - - for (const name of Object.keys(nets)) { - for (const net of nets[name]) { - // Skip over non-IPv4 and internal (i.e. 127.0.0.1) addresses - if (net.family === 'IPv4' && !net.internal) { - if (!results[name]) { - results[name] = []; - } - results[name].push(net.address); - } - } - } - - /** - * Offline case - */ - if (Object.keys(results).length === 0) { - return localhost; - } - - return results['en0'][0]; -} - -/** - * Terminal output colors - */ -const consoleColors = { - fgMagenta: 35, - fgRed: 31, - fgGreen: 32, - hiColor: 1, -}; - -/** - * Set a terminal color to the message - * - * @param {string} msg - text to wrap - * @param {string} color - color - * @returns {string} - */ -function wrapInColor(msg, color) { - return '\x1b[' + color + 'm' + msg + '\x1b[0m'; -} diff --git a/docs/CHANGELOG.md b/docs/CHANGELOG.md index 33aa0a099..fcb6078e9 100644 --- a/docs/CHANGELOG.md +++ b/docs/CHANGELOG.md @@ -11,6 +11,7 @@ - `Improvement` - The current block reference will be updated in read-only mode when blocks are clicked - `Fix` - codex-notifier and codex-tooltip moved from devDependencies to dependencies in package.json to solve type errors - `Fix` - Handle whitespace input in empty placeholder elements to prevent caret from moving unexpectedly to the end of the placeholder +- `DX` - Tools submodules removed from the repository ### 2.30.7 diff --git a/package.json b/package.json index 8081225f2..9447e0c70 100644 --- a/package.json +++ b/package.json @@ -21,13 +21,6 @@ "lint:errors": "eslint src/ --ext .ts --quiet", "lint:fix": "eslint src/ --ext .ts --fix", "lint:tests": "eslint test/ --ext .ts", - "pull_tools": "git submodule update --init --recursive", - "_tools:checkout": "git submodule foreach \"git checkout master || git checkout main\"", - "_tools:pull": "git submodule foreach git pull", - "_tools:yarn": "git submodule foreach yarn", - "_tools:build": "git submodule foreach yarn build", - "_tools:make": "yarn _tools:yarn && yarn _tools:build", - "tools:update": "yarn _tools:checkout && yarn _tools:pull && yarn _tools:make", "test:e2e": "yarn build:test && cypress run", "test:e2e:open": "yarn build:test && cypress open", "devserver:start": "yarn build && node ./devserver.js" From 5439086cf6b9dbdc43e40fdcb3d58bde765bfbb0 Mon Sep 17 00:00:00 2001 From: Peter Savchenko Date: Tue, 7 Jan 2025 19:26:36 +0300 Subject: [PATCH 3/3] Update package.json --- package.json | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/package.json b/package.json index 9447e0c70..72780aee1 100644 --- a/package.json +++ b/package.json @@ -22,8 +22,7 @@ "lint:fix": "eslint src/ --ext .ts --fix", "lint:tests": "eslint test/ --ext .ts", "test:e2e": "yarn build:test && cypress run", - "test:e2e:open": "yarn build:test && cypress open", - "devserver:start": "yarn build && node ./devserver.js" + "test:e2e:open": "yarn build:test && cypress open" }, "author": "CodeX", "license": "Apache-2.0",