From 080da4208d0cdc62d173cb0c96b2d17a71729e4b Mon Sep 17 00:00:00 2001 From: rcraig12 Date: Fri, 11 Nov 2022 00:33:53 +0000 Subject: [PATCH 1/3] react nodes --- .../e4e1b2e6-26a1-4b3b-b472-4464814fa69a.json | 51 +++++++ .../8f8bd450-3f2b-45a5-abcc-12b633899c77.json | 127 ++++++++++++++++++ .../e257d740-d47d-4794-82f1-3704850bdba9.json | 56 ++++++++ 3 files changed, 234 insertions(+) create mode 100644 react/dependency installer/e4e1b2e6-26a1-4b3b-b472-4464814fa69a.json create mode 100644 react/react dependency installer/8f8bd450-3f2b-45a5-abcc-12b633899c77.json create mode 100644 react/react installer/e257d740-d47d-4794-82f1-3704850bdba9.json diff --git a/react/dependency installer/e4e1b2e6-26a1-4b3b-b472-4464814fa69a.json b/react/dependency installer/e4e1b2e6-26a1-4b3b-b472-4464814fa69a.json new file mode 100644 index 00000000..e0390ff6 --- /dev/null +++ b/react/dependency installer/e4e1b2e6-26a1-4b3b-b472-4464814fa69a.json @@ -0,0 +1,51 @@ +{ + "implementations": { + "es6-node": { + "inputFunctions": { + "045a62ad-7340-479a-b544-f10d56f16597": "const { exec } = require( \"child_process\" );\nconst { sync } = data;\nconst { dependencies } = params;\nif (data.start !== false ){\n const command = \"cd \" + data.projectPath + \" && \" + \"npm install \" + params.dependencies.join(' ');\n outputs.stdout( command, tag );\n if (state.running){\n outputs.bounced(data.sync, tag);\n } else {\n state.running = true;\n exec(command, (error, stdout, stderr) => {\n if (error) {\n outputs.error(`${error}`, tag);\n } else {\n outputs.stdout(stdout || \"\", tag);\n outputs.stderr(stderr || \"\", tag);\n outputs.error(null, tag);\n }\n state.running = false;\n });\n }\n}" + } + } + }, + "interface": { + "inputs": { + "93078915-107a-4854-baaf-e2cdd4c06760": { + "type": "string[]", + "name": "dependencies", + "description": "Array of npm dependencies to install.\n\neg.\n\n[\"a\",\"b\"]" + }, + "045a62ad-7340-479a-b544-f10d56f16597": { + "type": "any", + "name": "sync", + "description": "{\n \"projectPath\": string,\n \"start\": boolean\n}" + } + }, + "outputs": { + "86e1623a-d67c-4e74-98bb-449e29005d56": { + "type": "string", + "name": "stdout" + }, + "735430f5-61ba-48c6-a8a6-e952edcb259e": { + "type": "string", + "name": "stderr" + }, + "8b7a505c-873e-4936-9195-f1b3e28c5520": { + "type": "(string or null)", + "name": "error" + }, + "4c3736af-6977-4632-b048-5446eaa87edd": { + "type": "any", + "name": "bounced" + } + } + }, + "name": "react/Dependency Installer", + "iconId": "abac34e3-c832-4c7b-b045-62f82ebc3ddb", + "keywords": { + "": null + }, + "description": "Install dependencies using npm for the react application", + "attributes": { + "internal": true, + "locked": true + } +} diff --git a/react/react dependency installer/8f8bd450-3f2b-45a5-abcc-12b633899c77.json b/react/react dependency installer/8f8bd450-3f2b-45a5-abcc-12b633899c77.json new file mode 100644 index 00000000..984cdc15 --- /dev/null +++ b/react/react dependency installer/8f8bd450-3f2b-45a5-abcc-12b633899c77.json @@ -0,0 +1,127 @@ +{ + "name": "react/React Dependency Installer", + "description": "Installs dependencies defined by the user for the react installer node. Node uses npm to install the dependencies on the same application path as the react application.", + "interface": { + "inputs": { + "1fc459fc-545e-4675-9916-b94bcab3563c": { + "type": "string[]", + "name": "dependencies", + "description": "Array of npm dependencies to install.\n\neg.\n\n[\"a\",\"b\"]" + }, + "9484b15d-ca86-4d63-b07f-cb4f8f21e88b": { + "type": "string", + "name": "projectPath", + "description": "[Inherited from port `projectPath` of `syncer`] \nReceives full file path of react application." + }, + "6668cb7f-874b-4c24-ae30-89fe2e24bad1": { + "type": "any", + "name": "start", + "description": "[Inherited from port `start` of `syncer`] \nReceives individual item for syncing." + } + }, + "outputs": { + "82d5b775-4619-466e-bb33-52c9b630500b": { + "type": "typeof `stdout` of `react dependency installer`", + "name": "stdout" + }, + "9c6331a7-5dde-4bb4-a12d-f4a7b1b02ce1": { + "type": "typeof `stderr` of `react dependency installer`", + "name": "stderr" + }, + "9c820c27-01f9-4a84-b2d3-a112e05dbb72": { + "type": "typeof `error` of `react dependency installer`", + "name": "error" + }, + "4655960f-34c8-41ff-b9e0-3fe400b97c5d": { + "type": "typeof `bounced` of `react dependency installer`", + "name": "bounced" + } + } + }, + "implementations": { + "cranq": { + "nodes": { + "1cd55979-d276-4251-8602-b1e7584641e6": { + "coordinates": [ + 95, + -55 + ], + "name": "Dependency Installer", + "prototype": "e4e1b2e6-26a1-4b3b-b472-4464814fa69a", + "params": {} + }, + "0726521e-634a-461a-aa98-f4ea527b2bf8": { + "coordinates": [ + -54, + 14 + ], + "name": "Syncer", + "prototype": "222a7543-3692-4c6d-b027-c422c99b23a1", + "params": { + "ef31c1e9-cfd5-458b-8d3a-951e3db9c232": "[\"projectPath\",\"start\"]" + } + } + }, + "connections": { + "0726521e-634a-461a-aa98-f4ea527b2bf8": { + "75cde7e3-b158-4836-8bcd-a89e72314ee8": { + "1cd55979-d276-4251-8602-b1e7584641e6": { + "045a62ad-7340-479a-b544-f10d56f16597": {} + } + } + } + }, + "forwards": { + "inputs": { + "6668cb7f-874b-4c24-ae30-89fe2e24bad1": { + "0726521e-634a-461a-aa98-f4ea527b2bf8": { + "start": {} + } + }, + "9484b15d-ca86-4d63-b07f-cb4f8f21e88b": { + "0726521e-634a-461a-aa98-f4ea527b2bf8": { + "projectPath": {} + } + }, + "1fc459fc-545e-4675-9916-b94bcab3563c": { + "1cd55979-d276-4251-8602-b1e7584641e6": { + "93078915-107a-4854-baaf-e2cdd4c06760": {} + } + } + }, + "outputs": { + "82d5b775-4619-466e-bb33-52c9b630500b": { + "1cd55979-d276-4251-8602-b1e7584641e6": { + "86e1623a-d67c-4e74-98bb-449e29005d56": {} + } + }, + "9c6331a7-5dde-4bb4-a12d-f4a7b1b02ce1": { + "1cd55979-d276-4251-8602-b1e7584641e6": { + "735430f5-61ba-48c6-a8a6-e952edcb259e": {} + } + }, + "9c820c27-01f9-4a84-b2d3-a112e05dbb72": { + "1cd55979-d276-4251-8602-b1e7584641e6": { + "8b7a505c-873e-4936-9195-f1b3e28c5520": {} + } + }, + "4655960f-34c8-41ff-b9e0-3fe400b97c5d": { + "1cd55979-d276-4251-8602-b1e7584641e6": { + "4c3736af-6977-4632-b048-5446eaa87edd": {} + } + } + } + } + } + }, + "iconId": "abac34e3-c832-4c7b-b045-62f82ebc3ddb", + "keywords": { + "react": null, + "npm": null, + "dependency": null, + "installer": null + }, + "attributes": { + "locked": true + } +} diff --git a/react/react installer/e257d740-d47d-4794-82f1-3704850bdba9.json b/react/react installer/e257d740-d47d-4794-82f1-3704850bdba9.json new file mode 100644 index 00000000..ab04f498 --- /dev/null +++ b/react/react installer/e257d740-d47d-4794-82f1-3704850bdba9.json @@ -0,0 +1,56 @@ +{ + "implementations": { + "es6-node": { + "inputFunctions": { + "df3107d7-179c-4e60-86b4-323813c9e86e": "const { exec } = require( \"child_process\" );\nconst { projectPath } = data;\nconst { replace } = params;\nlet command = \"npx create-react-app \" + data + \" --use-npm\";\nif (state.running){\n outputs.bounced(data, tag);\n} else {\n state.running = true;\n if ( params.replace === true ) {\n command = \"rm -rf \" + data + \" && npx create-react-app \" + data + \" --use-npm\";\n }\n outputs.stdout( command, tag );\n exec(command, (error, stdout, stderr) => {\nif (error && (params.replace === false || 'undefined' )) {\n outputs.error(`Application folder already exists. Set the replace input to true if you wish to reinstall the application from scratch`, tag);\n outputs.trigger(false, tag);\n} else {\n outputs.stdout(stdout || \"\", tag);\n outputs.stderr(stderr || \"\", tag);\n outputs.error(null, tag);\n outputs.trigger(true, tag);\n}\n state.running = false;\n });\n}" + } + } + }, + "interface": { + "inputs": { + "df3107d7-179c-4e60-86b4-323813c9e86e": { + "type": "string", + "name": "projectPath", + "description": "Full file path of react application." + }, + "32afb2d1-73c5-437c-a82a-8ec997b9a9c1": { + "type": "boolean", + "name": "replace", + "description": "Should the node delete and reinstall the application?\n\nboolean: defaults to false." + } + }, + "outputs": { + "94074b45-8d35-46d1-8a73-f09c55487709": { + "type": "boolean", + "name": "trigger", + "description": "Sends true@\"start\" right after the installer completes successfully." + }, + "531c9742-9153-400a-ab29-160e618d4b04": { + "type": "any", + "name": "stdout" + }, + "c33ef99d-731e-47fc-82da-8bc9ec3cca30": { + "type": "any", + "name": "stderr" + }, + "657b3ec0-1b44-4bd6-8a8e-7cf4e903823e": { + "type": "any", + "name": "error" + }, + "ae982924-274e-4871-9d75-4725bcce2eb2": { + "type": "any", + "name": "bounced" + } + } + }, + "name": "react/React Installer", + "iconId": "abac34e3-c832-4c7b-b045-62f82ebc3ddb", + "keywords": { + "react": null, + "installer": null + }, + "description": "Installs a react application to a location set by string:projectPath", + "attributes": { + "locked": true + } +} From 148c2d7330ea3ac7ca2f390d462c9a1e6b857a3a Mon Sep 17 00:00:00 2001 From: rcraig12 Date: Fri, 11 Nov 2022 15:52:33 +0000 Subject: [PATCH 2/3] ammendments to satisfy pull request --- .../8f8bd450-3f2b-45a5-abcc-12b633899c77.json | 30 +++++++++---------- .../e4e1b2e6-26a1-4b3b-b472-4464814fa69a.json | 18 +++++------ .../e257d740-d47d-4794-82f1-3704850bdba9.json | 8 ++--- 3 files changed, 28 insertions(+), 28 deletions(-) rename react/{dependency installer => react dependency installer/installer}/e4e1b2e6-26a1-4b3b-b472-4464814fa69a.json (50%) diff --git a/react/react dependency installer/8f8bd450-3f2b-45a5-abcc-12b633899c77.json b/react/react dependency installer/8f8bd450-3f2b-45a5-abcc-12b633899c77.json index 984cdc15..b82a0123 100644 --- a/react/react dependency installer/8f8bd450-3f2b-45a5-abcc-12b633899c77.json +++ b/react/react dependency installer/8f8bd450-3f2b-45a5-abcc-12b633899c77.json @@ -11,29 +11,29 @@ "9484b15d-ca86-4d63-b07f-cb4f8f21e88b": { "type": "string", "name": "projectPath", - "description": "[Inherited from port `projectPath` of `syncer`] \nReceives full file path of react application." + "description": "Installation path for npm installer.\n" }, "6668cb7f-874b-4c24-ae30-89fe2e24bad1": { "type": "any", - "name": "start", - "description": "[Inherited from port `start` of `syncer`] \nReceives individual item for syncing." + "name": "run", + "description": "Run npm installer if boolean value received is true.\n" } }, "outputs": { "82d5b775-4619-466e-bb33-52c9b630500b": { - "type": "typeof `stdout` of `react dependency installer`", + "type": "any", "name": "stdout" }, "9c6331a7-5dde-4bb4-a12d-f4a7b1b02ce1": { - "type": "typeof `stderr` of `react dependency installer`", + "type": "any", "name": "stderr" }, "9c820c27-01f9-4a84-b2d3-a112e05dbb72": { - "type": "typeof `error` of `react dependency installer`", + "type": "{ \"error\" : string}", "name": "error" }, "4655960f-34c8-41ff-b9e0-3fe400b97c5d": { - "type": "typeof `bounced` of `react dependency installer`", + "type": "any", "name": "bounced" } } @@ -46,7 +46,7 @@ 95, -55 ], - "name": "Dependency Installer", + "name": "dependency installer", "prototype": "e4e1b2e6-26a1-4b3b-b472-4464814fa69a", "params": {} }, @@ -58,7 +58,7 @@ "name": "Syncer", "prototype": "222a7543-3692-4c6d-b027-c422c99b23a1", "params": { - "ef31c1e9-cfd5-458b-8d3a-951e3db9c232": "[\"projectPath\",\"start\"]" + "ef31c1e9-cfd5-458b-8d3a-951e3db9c232": "[\"projectPath\",\"run\"]" } } }, @@ -73,20 +73,20 @@ }, "forwards": { "inputs": { + "1fc459fc-545e-4675-9916-b94bcab3563c": { + "1cd55979-d276-4251-8602-b1e7584641e6": { + "93078915-107a-4854-baaf-e2cdd4c06760": {} + } + }, "6668cb7f-874b-4c24-ae30-89fe2e24bad1": { "0726521e-634a-461a-aa98-f4ea527b2bf8": { - "start": {} + "run": {} } }, "9484b15d-ca86-4d63-b07f-cb4f8f21e88b": { "0726521e-634a-461a-aa98-f4ea527b2bf8": { "projectPath": {} } - }, - "1fc459fc-545e-4675-9916-b94bcab3563c": { - "1cd55979-d276-4251-8602-b1e7584641e6": { - "93078915-107a-4854-baaf-e2cdd4c06760": {} - } } }, "outputs": { diff --git a/react/dependency installer/e4e1b2e6-26a1-4b3b-b472-4464814fa69a.json b/react/react dependency installer/installer/e4e1b2e6-26a1-4b3b-b472-4464814fa69a.json similarity index 50% rename from react/dependency installer/e4e1b2e6-26a1-4b3b-b472-4464814fa69a.json rename to react/react dependency installer/installer/e4e1b2e6-26a1-4b3b-b472-4464814fa69a.json index e0390ff6..bd80edc1 100644 --- a/react/dependency installer/e4e1b2e6-26a1-4b3b-b472-4464814fa69a.json +++ b/react/react dependency installer/installer/e4e1b2e6-26a1-4b3b-b472-4464814fa69a.json @@ -2,7 +2,7 @@ "implementations": { "es6-node": { "inputFunctions": { - "045a62ad-7340-479a-b544-f10d56f16597": "const { exec } = require( \"child_process\" );\nconst { sync } = data;\nconst { dependencies } = params;\nif (data.start !== false ){\n const command = \"cd \" + data.projectPath + \" && \" + \"npm install \" + params.dependencies.join(' ');\n outputs.stdout( command, tag );\n if (state.running){\n outputs.bounced(data.sync, tag);\n } else {\n state.running = true;\n exec(command, (error, stdout, stderr) => {\n if (error) {\n outputs.error(`${error}`, tag);\n } else {\n outputs.stdout(stdout || \"\", tag);\n outputs.stderr(stderr || \"\", tag);\n outputs.error(null, tag);\n }\n state.running = false;\n });\n }\n}" + "045a62ad-7340-479a-b544-f10d56f16597": "const { exec } = require( \"child_process\" );\nconst { dependencies } = params;\nif (data.start !== false ){\n const command = \"cd \" + data.projectPath + \" && \" + \"npm install \" + params.dependencies.join(' ');\n outputs.stdout( command, tag );\n if (state.running){\n outputs.bounced(data, tag);\n } else {\n state.running = true;\n exec(command, (error, stdout, stderr) => {\n if (error) {\n outputs.error(`${error}`, tag);\n } else {\n outputs.stdout(stdout || \"\", tag);\n outputs.stderr(stderr || \"\", tag);\n outputs.error(null, tag);\n }\n state.running = false;\n });\n }\n}" } } }, @@ -14,22 +14,22 @@ "description": "Array of npm dependencies to install.\n\neg.\n\n[\"a\",\"b\"]" }, "045a62ad-7340-479a-b544-f10d56f16597": { - "type": "any", - "name": "sync", - "description": "{\n \"projectPath\": string,\n \"start\": boolean\n}" + "type": "{\n\"projectPath\": string, \n\"start\": boolean\n}", + "name": "projectPath & start", + "description": "" } }, "outputs": { "86e1623a-d67c-4e74-98bb-449e29005d56": { - "type": "string", + "type": "any", "name": "stdout" }, "735430f5-61ba-48c6-a8a6-e952edcb259e": { - "type": "string", + "type": "any", "name": "stderr" }, "8b7a505c-873e-4936-9195-f1b3e28c5520": { - "type": "(string or null)", + "type": "{ \"error\" : string}", "name": "error" }, "4c3736af-6977-4632-b048-5446eaa87edd": { @@ -38,12 +38,12 @@ } } }, - "name": "react/Dependency Installer", + "name": "react/React Dependency Installer/Installer", "iconId": "abac34e3-c832-4c7b-b045-62f82ebc3ddb", "keywords": { "": null }, - "description": "Install dependencies using npm for the react application", + "description": "see react/React Dependency Installer", "attributes": { "internal": true, "locked": true diff --git a/react/react installer/e257d740-d47d-4794-82f1-3704850bdba9.json b/react/react installer/e257d740-d47d-4794-82f1-3704850bdba9.json index ab04f498..032fdbd2 100644 --- a/react/react installer/e257d740-d47d-4794-82f1-3704850bdba9.json +++ b/react/react installer/e257d740-d47d-4794-82f1-3704850bdba9.json @@ -2,7 +2,7 @@ "implementations": { "es6-node": { "inputFunctions": { - "df3107d7-179c-4e60-86b4-323813c9e86e": "const { exec } = require( \"child_process\" );\nconst { projectPath } = data;\nconst { replace } = params;\nlet command = \"npx create-react-app \" + data + \" --use-npm\";\nif (state.running){\n outputs.bounced(data, tag);\n} else {\n state.running = true;\n if ( params.replace === true ) {\n command = \"rm -rf \" + data + \" && npx create-react-app \" + data + \" --use-npm\";\n }\n outputs.stdout( command, tag );\n exec(command, (error, stdout, stderr) => {\nif (error && (params.replace === false || 'undefined' )) {\n outputs.error(`Application folder already exists. Set the replace input to true if you wish to reinstall the application from scratch`, tag);\n outputs.trigger(false, tag);\n} else {\n outputs.stdout(stdout || \"\", tag);\n outputs.stderr(stderr || \"\", tag);\n outputs.error(null, tag);\n outputs.trigger(true, tag);\n}\n state.running = false;\n });\n}" + "df3107d7-179c-4e60-86b4-323813c9e86e": "const fs = require(\"fs\");\r\nconst { exec } = require( \"child_process\" );\r\nconst { replace } = params;\r\nconst command = \"npx create-react-app \" + data + \" --use-npm\";\r\nif (state.running){\r\n outputs.bounced(data, tag);\r\n} else {\r\n state.running = true;\r\n if ( params.replace === true && fs.existsSync(data + \"/.cranq-react-app\") ) {\r\n outputs.stdout(\"Removing react application at \" + data);\r\n fs.rmSync( data, { recursive: true, force: true }, (error) => { \r\n outputs.error({ \"error\" : \"Error deleting react application.\"});\r\n });\r\n }\r\n outputs.stdout( command, tag );\r\n exec(command, (error, stdout, stderr) => {\r\nif (error && (params.replace === false || 'undefined' )) {\r\n outputs.error({ \"error\" : \"Application folder already exists. Set the replace input to true if you wish to reinstall the application from scratch\" }, tag);\r\n outputs.success(false, tag);\r\n} else {\r\n outputs.stdout(stdout || \"\", tag);\r\n outputs.stderr(stderr || \"\", tag);\r\n fs.writeFileSync(data + \"/.cranq-react-app\", \"\");\r\n outputs.success(true, tag);\r\n}\r\n state.running = false;\r\n });\r\n}" } } }, @@ -16,13 +16,13 @@ "32afb2d1-73c5-437c-a82a-8ec997b9a9c1": { "type": "boolean", "name": "replace", - "description": "Should the node delete and reinstall the application?\n\nboolean: defaults to false." + "description": "Should the node delete and reinstall the application?\n\nboolean: defaults to false.\n\nUse as a static parameter only." } }, "outputs": { "94074b45-8d35-46d1-8a73-f09c55487709": { "type": "boolean", - "name": "trigger", + "name": "success", "description": "Sends true@\"start\" right after the installer completes successfully." }, "531c9742-9153-400a-ab29-160e618d4b04": { @@ -49,7 +49,7 @@ "react": null, "installer": null }, - "description": "Installs a react application to a location set by string:projectPath", + "description": "Installs a react application to a location set by `projectPath`.", "attributes": { "locked": true } From 9f1dd96ab001a8872a3f04cf24289050c85dfbc2 Mon Sep 17 00:00:00 2001 From: rcraig12 Date: Fri, 11 Nov 2022 15:55:33 +0000 Subject: [PATCH 3/3] Syncer changed to sync parameters --- .../8f8bd450-3f2b-45a5-abcc-12b633899c77.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/react/react dependency installer/8f8bd450-3f2b-45a5-abcc-12b633899c77.json b/react/react dependency installer/8f8bd450-3f2b-45a5-abcc-12b633899c77.json index b82a0123..85c29fdd 100644 --- a/react/react dependency installer/8f8bd450-3f2b-45a5-abcc-12b633899c77.json +++ b/react/react dependency installer/8f8bd450-3f2b-45a5-abcc-12b633899c77.json @@ -55,7 +55,7 @@ -54, 14 ], - "name": "Syncer", + "name": "sync parameters", "prototype": "222a7543-3692-4c6d-b027-c422c99b23a1", "params": { "ef31c1e9-cfd5-458b-8d3a-951e3db9c232": "[\"projectPath\",\"run\"]"