Socket
Socket
Sign inDemoInstall

@cocoon/editor

Package Overview
Dependencies
628
Maintainers
1
Versions
38
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 0.110.0 to 0.111.0

2

dist/cocoon-editor-http.js
#!/usr/bin/env node
"use strict";function _interopDefault(e){return e&&"object"==typeof e&&"default"in e?e.default:e}var fs=_interopDefault(require("fs")),http=_interopDefault(require("http")),mime=_interopDefault(require("mime-types")),path=_interopDefault(require("path")),url=_interopDefault(require("url")),util=_interopDefault(require("util"));const debug=require("debug")("http:index"),readFileAsync=util.promisify(fs.readFile),existsAsync=util.promisify(fs.exists),serverPort=22242,staticFolders=[path.resolve(__dirname,"ui"),path.resolve(path.dirname(require.resolve("@cocoon/monaco")))];async function serveStaticFile(e,t){const i=(await Promise.all(e.map(async e=>await existsAsync(e)?e:null))).find(e=>Boolean(e));if(debug(`=> ${i}`),i){const e=await readFileAsync(i,{encoding:"utf8"}),r=mime.lookup(i);t.writeHead(200,r?{"Content-Type":r}:void 0),t.end(e)}else t.writeHead(404),t.end()}process.title=__filename,http.createServer((e,t)=>{try{if(e.url){debug(e.url);const i=url.parse("/"===e.url?"/editor.html":e.url);if("/component"===i.pathname){serveStaticFile([new URLSearchParams(i.search||void 0).get("path")],t)}else{serveStaticFile(staticFolders.map(e=>path.join(e,i.pathname||"")),t)}}else t.end()}catch(e){t.writeHead(500),t.end()}}).listen(22242),debug("listening on port 22242");
"use strict";function e(e){return e&&"object"==typeof e&&"default"in e?e.default:e}var r=e(require("fs")),t=e(require("http")),i=e(require("mime-types")),n=e(require("path")),a=e(require("url")),o=e(require("util"));const s=require("debug")("http:index"),l=o.promisify(r.readFile),u=o.promisify(r.exists),c=[n.resolve(__dirname,"ui"),n.resolve(n.dirname(require.resolve("@cocoon/monaco")))];async function d(e,r){const t=(await Promise.all(e.map(async e=>await u(e)?e:null))).find(e=>Boolean(e));if(s("=> "+t),t){const e=await l(t,{encoding:"utf8"}),n=i.lookup(t);r.writeHead(200,n?{"Content-Type":n}:void 0),r.end(e)}else r.writeHead(404),r.end()}process.title=__filename,t.createServer((e,r)=>{try{if(e.url){s(e.url);const t=a.parse("/"===e.url?"/editor.html":e.url);if("/component"===t.pathname){const e=new URLSearchParams(t.search||void 0);d([e.get("path")],r)}else{d(c.map(e=>n.join(e,t.pathname||"")),r)}}else r.end()}catch(e){r.writeHead(500),r.end()}}).listen(22242),s("listening on port 22242");
#!/usr/bin/env node --inspect=9340
"use strict";function _interopDefault(e){return e&&"object"==typeof e&&"default"in e?e.default:e}var cocoon=require("@cocoon/cocoon"),createServer=_interopDefault(require("@cocoon/util/ipc/createServer")),requestCocoonUri=require("@cocoon/util/ipc/requestCocoonUri"),child_process=require("child_process"),program=_interopDefault(require("commander")),Debug=_interopDefault(require("debug")),open=_interopDefault(require("open")),path=_interopDefault(require("path")),WebSocket=_interopDefault(require("ws")),_=_interopDefault(require("lodash"));const baseUrl="http://127.0.0.1:22242";function createEditorURI(e,o){const r=Object.keys(o).reduce((e,r)=>{const t=o[r];return _.isNil(t)||e.push(`${r}=${t}`),e},[]).join("&");return`${baseUrl}/${e}${r?"?"+r:""}`}const packageJson=require("../package.json"),debug=Debug("editor:index"),httpServerName="cocoon-editor-http",state={cocoonProcess:null,httpServerProcess:null},splash="\n β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ\n β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ\n β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ\n β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ\n β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ\n β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–‘β–‘β–‘β–‘β–‘β–‘β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ\n β–ˆβ–ˆβ–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–ˆβ–ˆβ–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–ˆβ–ˆ\n β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–‘β–‘β–‘β–‘β–‘β–‘β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ\n β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ\n β–“β–“β–“β–“ β–“β–“β–“β–“β–“β–“ β–“β–“β–“β–“\n β–“β–“β–“β–“ β–ˆβ–ˆβ–ˆβ–ˆ β–“β–“ β–ˆβ–ˆβ–ˆβ–ˆ β–“β–“β–“β–“\n β–“β–“β–“β–“ β–ˆβ–ˆβ–ˆβ–ˆ β–“β–“ β–ˆβ–ˆβ–ˆβ–ˆ β–“β–“β–“β–“\n β–“β–“β–“β–“β–“β–“ β–‘β–‘β–‘β–‘ β–“β–“β–“β–“β–“β–“\n β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β–‘β–‘β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“\n β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“\n β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“ β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“\n β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“ β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“\n β–“β–“β–“β–“ β–“β–“β–“β–“\n β–“β–“β–“β–“ β–“β–“β–“β–“\n β–“β–“ β–“β–“\n β–“β–“ β–“β–“\n β–“β–“ β–“β–“\n β–‘β–‘ β–‘β–‘\n β–‘β–‘β–‘β–‘ β–‘β–‘β–‘β–‘\n\n β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“\n β–“β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–“\n β–“β–‘ Welcome to Cocoon -- open this URL: β–‘β–“\n β–“β–‘ http://127.0.0.1:22242/editor.html β–‘β–“\n β–“β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–“\n β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“\n\n";function spawnHttpServer(){if(state.httpServerProcess)throw new Error(`${httpServerName} is already running`);return debug(`spawning ${httpServerName}`),state.httpServerProcess=child_process.spawn("node",["--inspect=9341",path.resolve(__dirname,`${httpServerName}.js`)],{cwd:path.resolve(__dirname,".."),detached:!1,stdio:[process.stdin,process.stdout,process.stderr,"ipc"]}),state.httpServerProcess}function killHttpServer(){state.httpServerProcess&&(debug(`killing ${httpServerName}`),state.httpServerProcess.kill())}async function initialiseBrowser(e={}){debug("opening browser");const o=createEditorURI("editor.html",{file:e.cocoonFilePath});e.browserPath?child_process.exec(`"${e.browserPath}" "${o}"`):open(o)}async function initialise(e={}){const o=createServer.bind(null,WebSocket,22245,Debug("editor:ipc"));if(e.cocoonUri){const r=await o();debug(`using Cocoon instance at "${e.cocoonUri}"`),requestCocoonUri.onRequestCocoonUri(r,()=>({uri:e.cocoonUri}))}else{const[e,r]=await Promise.all([cocoon.initialise(),await o()]);debug("created local Cocoon instance"),requestCocoonUri.onRequestCocoonUri(r,()=>({}))}}program.version(packageJson.version||"unknown").description("Runs the Cocoon editor").arguments("[yml]").option("-c, --connect <url>","Connect to an existing Cocoon processing kernel").option("--browser-path <path>","Path to the browser executable").option("--headless","Run the editor headlessly").action(async(e,o)=>{Debug.enable("cocoon:*,editor:*,http:*"),spawnHttpServer(),await initialise({cocoonUri:o.connect}),o.headless||await initialiseBrowser({browserPath:o.browser||process.env.COCOON_BROWSER_PATH,cocoonFilePath:e?path.resolve(e):e}),process.stdout.write(splash)}),process.title=__filename,process.env.DEBUG_COLORS=1,process.on("warning",e=>{e.stack&&process.stderr.write(e.stack)}),process.on("exit",killHttpServer),process.on("SIGHUP",()=>process.exit(0)),program.parse(process.argv);
"use strict";function e(e){return e&&"object"==typeof e&&"default"in e?e.default:e}var o=require("@cocoon/cocoon"),n=e(require("@cocoon/util/ipc/createServer")),r=require("@cocoon/util/ipc/requestCocoonUri"),t=require("child_process"),c=e(require("commander")),s=e(require("debug")),i=e(require("open")),a=e(require("path")),p=e(require("ws")),u=e(require("lodash"));const l=require("../package.json"),d=s("editor:index"),h={cocoonProcess:null,httpServerProcess:null};async function w(e={}){d("opening browser");const o=function(e,o){const n=Object.keys(o).reduce((e,n)=>{const r=o[n];return u.isNil(r)||e.push(`${n}=${r}`),e},[]).join("&");return`http://127.0.0.1:22242/${e}${n?"?"+n:""}`}("editor.html",{file:e.cocoonFilePath});e.browserPath?t.exec(`"${e.browserPath}" "${o}"`):i(o)}c.version(l.version||"unknown").description("Runs the Cocoon editor").arguments("[yml]").option("-c, --connect <url>","Connect to an existing Cocoon processing kernel").option("--browser-path <path>","Path to the browser executable").option("--headless","Run the editor headlessly").action(async(e,c)=>{s.enable("cocoon:*,editor:*,http:*"),function(){if(h.httpServerProcess)throw new Error("cocoon-editor-http is already running");d("spawning cocoon-editor-http"),h.httpServerProcess=t.spawn("node",["--inspect=9341",a.resolve(__dirname,"cocoon-editor-http.js")],{cwd:a.resolve(__dirname,".."),detached:!1,stdio:[process.stdin,process.stdout,process.stderr,"ipc"]}),h.httpServerProcess}(),await async function(e={}){const t=n.bind(null,p,22245,s("editor:ipc"));if(e.cocoonUri){const o=await t();d(`using Cocoon instance at "${e.cocoonUri}"`),r.onRequestCocoonUri(o,()=>({uri:e.cocoonUri}))}else{const[e,n]=await Promise.all([o.initialise(),await t()]);d("created local Cocoon instance"),r.onRequestCocoonUri(n,()=>({}))}}({cocoonUri:c.connect}),c.headless||await w({browserPath:c.browser||process.env.COCOON_BROWSER_PATH,cocoonFilePath:e?a.resolve(e):e}),process.stdout.write("\n β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ\n β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ\n β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ\n β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ\n β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ\n β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–‘β–‘β–‘β–‘β–‘β–‘β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ\n β–ˆβ–ˆβ–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–ˆβ–ˆβ–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–ˆβ–ˆ\n β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–‘β–‘β–‘β–‘β–‘β–‘β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ\n β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ\n β–“β–“β–“β–“ β–“β–“β–“β–“β–“β–“ β–“β–“β–“β–“\n β–“β–“β–“β–“ β–ˆβ–ˆβ–ˆβ–ˆ β–“β–“ β–ˆβ–ˆβ–ˆβ–ˆ β–“β–“β–“β–“\n β–“β–“β–“β–“ β–ˆβ–ˆβ–ˆβ–ˆ β–“β–“ β–ˆβ–ˆβ–ˆβ–ˆ β–“β–“β–“β–“\n β–“β–“β–“β–“β–“β–“ β–‘β–‘β–‘β–‘ β–“β–“β–“β–“β–“β–“\n β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β–‘β–‘β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“\n β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“\n β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“ β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“\n β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“ β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“\n β–“β–“β–“β–“ β–“β–“β–“β–“\n β–“β–“β–“β–“ β–“β–“β–“β–“\n β–“β–“ β–“β–“\n β–“β–“ β–“β–“\n β–“β–“ β–“β–“\n β–‘β–‘ β–‘β–‘\n β–‘β–‘β–‘β–‘ β–‘β–‘β–‘β–‘\n\n β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“\n β–“β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–“\n β–“β–‘ Welcome to Cocoon -- open this URL: β–‘β–“\n β–“β–‘ http://127.0.0.1:22242/editor.html β–‘β–“\n β–“β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–“\n β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“\n\n")}),process.title=__filename,process.env.DEBUG_COLORS=1,process.on("warning",e=>{e.stack&&process.stderr.write(e.stack)}),process.on("exit",(function(){h.httpServerProcess&&(d("killing cocoon-editor-http"),h.httpServerProcess.kill())})),process.on("SIGHUP",()=>process.exit(0)),c.parse(process.argv);
{
"name": "@cocoon/editor",
"version": "0.110.0",
"version": "0.111.0",
"author": "Lynn Smeria <ae@cephea.de>",

@@ -16,52 +16,53 @@ "license": "GPL-3.0-or-later",

"dependencies": {
"@cocoon/cocoon": "0.110.0",
"@cocoon/monaco": "0.110.0",
"commander": "^4.0.0",
"@cocoon/cocoon": "0.111.0",
"@cocoon/monaco": "0.111.0",
"commander": "^5.1.0",
"debug": "^4.1.1",
"mime-types": "2.1.25",
"open": "^7.0.0",
"tslib": "^1.10.0",
"mime-types": "^2.1.27",
"open": "^7.0.4",
"react-is": "16.13.1",
"tslib": "^2.0.0",
"websocket-as-promised": "^1.0.1",
"ws": "^7.1.2"
"ws": "^7.3.0"
},
"devDependencies": {
"@cocoon/types": "0.110.0",
"@cocoon/util": "0.110.0",
"@cocoon/types": "0.111.0",
"@cocoon/util": "0.111.0",
"@tippy.js/react": "3.1.1",
"@types/debug": "4.1.5",
"@types/lodash": "4.14.149",
"@types/lodash": "4.14.155",
"@types/mime-types": "2.1.0",
"@types/mousetrap": "1.6.3",
"@types/react": "16.9.17",
"@types/react-dom": "16.9.4",
"@types/react": "16.9.35",
"@types/react-dom": "16.9.8",
"@types/react-resize-detector": "4.2.0",
"@types/styled-components": "4.4.1",
"@types/webpack": "4.41.0",
"@types/ws": "6.0.4",
"ayu": "7.2.1",
"css-loader": "3.4.0",
"@types/styled-components": "5.1.0",
"@types/webpack": "4.41.17",
"@types/ws": "7.2.5",
"ayu": "7.2.2",
"css-loader": "3.5.3",
"isomorphic-ws": "4.0.1",
"lodash": "4.17.15",
"mousetrap": "1.6.3",
"nodemon": "2.0.2",
"mousetrap": "1.6.5",
"nodemon": "2.0.4",
"prop-types": "15.7.2",
"react": "16.12.0",
"react-dom": "16.12.0",
"react-draggable": "4.2.0",
"react-resize-detector": "4.2.1",
"react": "16.13.1",
"react-dom": "16.13.1",
"react-draggable": "4.4.3",
"react-resize-detector": "4.2.3",
"react-splitter-layout": "4.0.0",
"rollup": "1.27.14",
"rollup": "2.15.0",
"rollup-plugin-replace": "2.2.0",
"rollup-plugin-terser": "5.1.3",
"source-map-loader": "0.2.4",
"style-loader": "1.1.1",
"styled-components": "4.4.1",
"rollup-plugin-terser": "6.1.0",
"source-map-loader": "1.0.0",
"style-loader": "1.2.1",
"styled-components": "5.1.1",
"supports-color": "7.1.0",
"tippy.js": "5.1.2",
"webpack": "4.41.4",
"webpack-bundle-analyzer": "3.6.0",
"webpack-cli": "3.3.10"
"tippy.js": "5.2.1",
"webpack": "4.43.0",
"webpack-bundle-analyzer": "3.8.0",
"webpack-cli": "3.3.11"
},
"optionalDependencies": {
"@cocoon/plugin-inspect": "0.110.0"
"@cocoon/plugin-inspect": "0.111.0"
},

@@ -78,3 +79,3 @@ "scripts": {

},
"gitHead": "df73a3217707724df83af9b28348432681535623"
"gitHead": "cf8b2593de82c67729551f868c7160eca3f5b3fa"
}

Sorry, the diff of this file is too big to display

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚑️ by Socket Inc