From b858881940e7beefdd4e2ca37365660a0beb7d06 Mon Sep 17 00:00:00 2001 From: Muhammad-Altabba <24407834+Muhammad-Altabba@users.noreply.github.com> Date: Wed, 20 Sep 2023 11:31:28 +0200 Subject: [PATCH] restore mocking files and empty lines at packages/truffle --- .../node_modules/nodepkg/ImportOfImport.sol | 2 +- .../node_modules/nodepkg/LocalNodeImport.sol | 2 +- .../node_modules/nodepkg/NodeImport.sol | 2 +- .../truffle-mock/truffle-plugin.json | 6 ++++++ .../node_modules/truffle-mock/index.js | 20 +++++++++++++++++++ .../truffle-mock/truffle-plugin.json | 6 ++++++ .../truffle-mock/truffle-plugin.json | 5 +++++ .../node_modules/truffle-mock/index.js | 0 .../node_modules/truffle-mock/index.js | 0 .../truffle-mock/truffle-plugin.json | 1 + .../node_modules/truffle-mock/index.js | 7 +++++++ .../truffle-mock/truffle-plugin.json | 5 +++++ 12 files changed, 53 insertions(+), 3 deletions(-) create mode 100644 packages/truffle/test/sources/preserve/mockProjectWithAbsolutePath/node_modules/truffle-mock/truffle-plugin.json create mode 100644 packages/truffle/test/sources/preserve/mockProjectWithWorkingPlugin/node_modules/truffle-mock/index.js create mode 100644 packages/truffle/test/sources/preserve/mockProjectWithWorkingPlugin/node_modules/truffle-mock/truffle-plugin.json create mode 100644 packages/truffle/test/sources/run/mockProjectWithAbsolutePath/node_modules/truffle-mock/truffle-plugin.json create mode 100644 packages/truffle/test/sources/run/mockProjectWithMissingPluginConfig/node_modules/truffle-mock/index.js create mode 100644 packages/truffle/test/sources/run/mockProjectWithPlugin/node_modules/truffle-mock/index.js create mode 100644 packages/truffle/test/sources/run/mockProjectWithPlugin/node_modules/truffle-mock/truffle-plugin.json create mode 100644 packages/truffle/test/sources/run/mockProjectWithWorkingPlugin/node_modules/truffle-mock/index.js create mode 100644 packages/truffle/test/sources/run/mockProjectWithWorkingPlugin/node_modules/truffle-mock/truffle-plugin.json diff --git a/packages/truffle/test/sources/monorepo/node_modules/nodepkg/ImportOfImport.sol b/packages/truffle/test/sources/monorepo/node_modules/nodepkg/ImportOfImport.sol index 229e6216bb5..4eb5bb4e9ed 100644 --- a/packages/truffle/test/sources/monorepo/node_modules/nodepkg/ImportOfImport.sol +++ b/packages/truffle/test/sources/monorepo/node_modules/nodepkg/ImportOfImport.sol @@ -3,4 +3,4 @@ pragma solidity ^0.5.0; contract ImportOfImport { uint public importOfImport; constructor() public {} -} \ No newline at end of file +} diff --git a/packages/truffle/test/sources/monorepo/node_modules/nodepkg/LocalNodeImport.sol b/packages/truffle/test/sources/monorepo/node_modules/nodepkg/LocalNodeImport.sol index 1a98138a0e1..48b55eafffb 100644 --- a/packages/truffle/test/sources/monorepo/node_modules/nodepkg/LocalNodeImport.sol +++ b/packages/truffle/test/sources/monorepo/node_modules/nodepkg/LocalNodeImport.sol @@ -3,4 +3,4 @@ pragma solidity ^0.5.0; contract LocalNodeImport { uint public localNodeImport; constructor() public {} -} \ No newline at end of file +} diff --git a/packages/truffle/test/sources/monorepo/node_modules/nodepkg/NodeImport.sol b/packages/truffle/test/sources/monorepo/node_modules/nodepkg/NodeImport.sol index f5068142e8a..0757ee1727a 100644 --- a/packages/truffle/test/sources/monorepo/node_modules/nodepkg/NodeImport.sol +++ b/packages/truffle/test/sources/monorepo/node_modules/nodepkg/NodeImport.sol @@ -5,4 +5,4 @@ import "./ImportOfImport.sol"; contract NodeImport is ImportOfImport { uint nodeImport; constructor() public {} -} \ No newline at end of file +} diff --git a/packages/truffle/test/sources/preserve/mockProjectWithAbsolutePath/node_modules/truffle-mock/truffle-plugin.json b/packages/truffle/test/sources/preserve/mockProjectWithAbsolutePath/node_modules/truffle-mock/truffle-plugin.json new file mode 100644 index 00000000000..edc02791aa4 --- /dev/null +++ b/packages/truffle/test/sources/preserve/mockProjectWithAbsolutePath/node_modules/truffle-mock/truffle-plugin.json @@ -0,0 +1,6 @@ +{ + "preserve": { + "tag": "mock", + "recipe": "/index.js" + } +} diff --git a/packages/truffle/test/sources/preserve/mockProjectWithWorkingPlugin/node_modules/truffle-mock/index.js b/packages/truffle/test/sources/preserve/mockProjectWithWorkingPlugin/node_modules/truffle-mock/index.js new file mode 100644 index 00000000000..ffae726423f --- /dev/null +++ b/packages/truffle/test/sources/preserve/mockProjectWithWorkingPlugin/node_modules/truffle-mock/index.js @@ -0,0 +1,20 @@ +class Recipe { + static help = "Mock Recipe"; + + name = "truffle-mock"; + inputLabels = []; + outputLabels = []; + + constructor(environment) { + this.environmentName = environment.selectedEnvironment; + } + + async *execute({ controls }) { + yield* controls.update({ + message: `Provided environment name: ${this.environmentName}` + }); + return "Successfully called truffle-mock:preserve()"; + } +} + +module.exports = { Recipe }; diff --git a/packages/truffle/test/sources/preserve/mockProjectWithWorkingPlugin/node_modules/truffle-mock/truffle-plugin.json b/packages/truffle/test/sources/preserve/mockProjectWithWorkingPlugin/node_modules/truffle-mock/truffle-plugin.json new file mode 100644 index 00000000000..0170335795d --- /dev/null +++ b/packages/truffle/test/sources/preserve/mockProjectWithWorkingPlugin/node_modules/truffle-mock/truffle-plugin.json @@ -0,0 +1,6 @@ +{ + "preserve": { + "tag": "mock", + "recipe": "index.js" + } +} diff --git a/packages/truffle/test/sources/run/mockProjectWithAbsolutePath/node_modules/truffle-mock/truffle-plugin.json b/packages/truffle/test/sources/run/mockProjectWithAbsolutePath/node_modules/truffle-mock/truffle-plugin.json new file mode 100644 index 00000000000..e822cc08ce7 --- /dev/null +++ b/packages/truffle/test/sources/run/mockProjectWithAbsolutePath/node_modules/truffle-mock/truffle-plugin.json @@ -0,0 +1,5 @@ +{ + "commands": { + "mock": "/index.js" + } +} diff --git a/packages/truffle/test/sources/run/mockProjectWithMissingPluginConfig/node_modules/truffle-mock/index.js b/packages/truffle/test/sources/run/mockProjectWithMissingPluginConfig/node_modules/truffle-mock/index.js new file mode 100644 index 00000000000..e69de29bb2d diff --git a/packages/truffle/test/sources/run/mockProjectWithPlugin/node_modules/truffle-mock/index.js b/packages/truffle/test/sources/run/mockProjectWithPlugin/node_modules/truffle-mock/index.js new file mode 100644 index 00000000000..e69de29bb2d diff --git a/packages/truffle/test/sources/run/mockProjectWithPlugin/node_modules/truffle-mock/truffle-plugin.json b/packages/truffle/test/sources/run/mockProjectWithPlugin/node_modules/truffle-mock/truffle-plugin.json new file mode 100644 index 00000000000..0967ef424bc --- /dev/null +++ b/packages/truffle/test/sources/run/mockProjectWithPlugin/node_modules/truffle-mock/truffle-plugin.json @@ -0,0 +1 @@ +{} diff --git a/packages/truffle/test/sources/run/mockProjectWithWorkingPlugin/node_modules/truffle-mock/index.js b/packages/truffle/test/sources/run/mockProjectWithWorkingPlugin/node_modules/truffle-mock/index.js new file mode 100644 index 00000000000..bb56d56be27 --- /dev/null +++ b/packages/truffle/test/sources/run/mockProjectWithWorkingPlugin/node_modules/truffle-mock/index.js @@ -0,0 +1,7 @@ +const Mock = { + run() { + console.log("Running truffle-mock!"); + } +}; + +module.exports = Mock.run; diff --git a/packages/truffle/test/sources/run/mockProjectWithWorkingPlugin/node_modules/truffle-mock/truffle-plugin.json b/packages/truffle/test/sources/run/mockProjectWithWorkingPlugin/node_modules/truffle-mock/truffle-plugin.json new file mode 100644 index 00000000000..16357fab7c2 --- /dev/null +++ b/packages/truffle/test/sources/run/mockProjectWithWorkingPlugin/node_modules/truffle-mock/truffle-plugin.json @@ -0,0 +1,5 @@ +{ + "commands": { + "mock": "index.js" + } +}