diff --git a/.gitmodules b/.gitmodules deleted file mode 100644 index 44e1a2ff4..000000000 --- a/.gitmodules +++ /dev/null @@ -1,48 +0,0 @@ -[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/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/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 @@ - - - -
- -yarn build
- yarn pull_tools && yarn tools:update
-