Code Monkey home page Code Monkey logo

nodecloud's People

Contributors

amrita019 avatar cheesetouched avatar dependabot[bot] avatar hansikaw avatar lahirutech avatar lumencodes avatar mbcse avatar nilmapeiris avatar partik03 avatar pranjalwalia avatar rajikaimal avatar rajitha1998 avatar raju249 avatar rehrumesh avatar tromesh avatar vineet-sharma29 avatar zenvega avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

nodecloud's Issues

[TESTING] Tests for the Aliyun Generator

Describe the solution you'd like

  • Write tests for the Aliyun generator, integrate the parser and transformer to verify E2E functioning

Impact

  • updates the code generation module of NodeCloud.

Linked PR: #139

The Hosting docs GitHub workflow is failing

Expected Behavior

  • The hosting docs GitHub workflow should push the documentation to gh-pages.

Actual Behavior

  • The relevant workflow is failing

Possible Solution

Seems like the github secret is missing in the repo GITHUB_TOKEN: ${{ secrets.JSDoc_TOKEN }}. .JSDoc_TOKEN needs to be created in the project repository.

Automating the service class creation process of Node Cloud plugins

Describe the solution you'd like

  • Automate the process of manually creating classes for services in the Node Cloud plugins
  • Data needs to be extracted from the cloud provider SDKs and a parser needs to be used in this process
  • After extracting data JavaScript classes can be automatically generated using a transformer

Impact

  • A new component to the project which can automatically generate JavaScript classes

Typo errors in project documentation

image

Welcome to NodeCloud with Hacktoberfest 2020!

Stay in the know: Get notified of updates by clicking the πŸ‘β€πŸ—¨ watch button and save the repository for later reference by clicking the ⭐️ star button at the top right corner of this repo!

Some typo errors need to be fixed:

The readme file of the nodecloud-next branch contains some typo errors. To note some (typo error > correction),

  • NodeCloud ☁️ is standard library > NodeCloud ☁️ is a standard library
  • providers with less code changes > providers with fewer code changes
  • open source > open-source
  • community driven plugin > community-driven plugin,
  • third party > third-party
  • background knowlege on these > background knowledge on these
  • This is where magic happens✨ > This is where the magic happens✨
  • automactically > automatically
  • immediatly > immediately

These need to be corrected and if you identify more typo errors while reading, fix them as well. Feel free to add a comment for further clarifications!

Additional information

  • The project currently contains two main branches: master and nodecloud-next. This feature is required to the nodecloud-next branch. so make sure that you create the feature branch from nodecloud-next.

nodecloud-next: https://github.com/leopardslab/nodecloud/tree/nodecloud-next.

Impact

  • Read me file

Knowledge required

  • Version control systems (git)

Codacy changes

Take Codacy suggestions into account and make necessary changes to improve the code quality.

configPath is not being passed from nodecloud-core to plugins

In nodecloud/lib/core/base-provider.js, we process the input of .nc.config.js like this

ncConfig.map(provider => {
        const module = provider.plugin;
        providersToLoad[provider.tag] = module(ncConfig.configPath);
});

But shouldn't it be

ncConfig.map(provider => {
        const module = provider.plugin;
        providersToLoad[provider.tag] = module(provider.configPath);
});

Because ncConfig is an array of providers. So ncConfig.configPath = undefined
That's why we map the providers and it should be provider.configPath and it works that way too. The path is passed to the plugins when we use the latter approach.

[Not An Issue]Heads-up to the project

Hello everyone I am full-stack web developer in MERN and MEAN with a specialisation in Node Js. I also have knowledge of Docker,AWS and Azure I would like to contribute to Score Labs . I have been contributing to open source from past 2 yrs
I am aiming to contribute to Project No.10 - NodeCloud - Rackspace Provider - Services as I have all the prerequisites for the project. I would be highly grateful if I could get a start to contribute to Score labs

Creating NodeCloud digital ocean plugin

Describe the solution you'd like

  • Creating the digital ocean plugin using the created DO automation tool
  • Including it in the node cloud packages

Impact

NodeCloud package

Update ReadMe files for the Lerna project structure

Describe the solution you'd like

  • Updating project ReadMe files with the Node Cloud 2.0 architecture

Additional information

  • Add architecture diagrams to explain the code generation process

Impact

  • ReadMe files

Error when importing Node cloud package in sub directories

Expected Behavior

  • node cloud package should be successfully working on sub directories of a node cloud installed project where the .nc.config.js is configured in the project root.

Actual Behavior

  • node cloud works fine on the files in the root directory of the project
  • In sub directories throws an error Error: Cannot find module 'd:\node-cloud-demo\scripts\.nc.config'(A quick patch was to copy the .nc.config.js to the sub folder where I needed the package )

E.g. -
Node cloud working fine on root directory files
q

Node cloud crashing on sub directory files
w
Node cloud working fine on sub directory files after copying .nc.config.js to subdirectory
e

Steps to Reproduce the Problem

  1. Install node-cloud
  2. Require node-cloud in a sub directory of the project

Reason to the issue

  • Node cloud uses process.cwd() to get the current working directory to configure the ncConfig const ncConfig = require(path.join(process.cwd(), ".nc.config"));, In a sub-directory the .nc.config won't be there in the current directory.
Project-demo
β”‚   node_modules
β”‚   .nc.config.js
β”‚   package.json
β”‚   package-lock.json
β”‚   index.js -----------------------------  Node cloud works fine here

β”‚
β”‚
└─── scripts
    β”‚   tester.js -------------------------- Node cloud throws an error here 

Specifications

  • Version: 1.0.0-beta.1
  • Platform: Windows
  • Subsystem: run-time - node version 12

Move tests to plugins

Tests need to be moved to the respective plugins.
Change to new getProviders API.

  • nodecloud-gcp-plugin
  • nodecloud-azure-plugin

Doc: Create documentation for NodeCloud vocabulary

Current documentation doesn't explain the vocabulary of NodeCloud in a convenient manner. New users should be able to use the services without going through extra hassle to find the matching services in cloud providers and NodeCloud APIs.

A documentation page can be created with the vocabulary of current set of APIs in NodeCloud matched with vocabulary of the cloud providers.

AWS ec2 example hasn't been updated

Expected Behavior

After Introducing the getProviders function the AWS ec2 example hasn't been updated. The KeyName parameter was missing in the params object of the create AWS EC2 instance example which is in read me .

const optionsProvider = {
  overrideProviders: false
};
const ncProviders = nodeCloud.getProviders(optionsProvider);
const ec2 = ncProviders.aws.compute(options);

Actual Behavior

const ncAWS = nodeCloud.getProvider("AWS", process.env.ncconf);
const ec2 = ncAWS.compute(options);

Nodecloud doesn't require or instantiate nodecloud plugin

Expected Behavior

The Nodecloud base-provider.js needs to instantiate and require each and every provided plugin module via the getProvider method

After modifying the nodecloud base-provider.js module below. It works just fine

/**

Returns requested provider type

@param {Object} {provider - Type of provider - can be found here '/aws/provider'}
*/
getProviders(options) {
if (ncConfig === undefined) {
throw new Error(
"Provider config file not found. Please create a config file in project root."
);
}
let providersToLoad = {};

  if (options && options.hasOwnProperty("overrideProviders") ) {
    ncConfig.map(provider => {
      const module = provider.plugin;
        providersToLoad[provider.tag] = module(ncConfig.configPath);
      });
  } else {

    ncConfig.map(provider => {
    if (!validProviders.includes(provider.name)) {
      throw new Error("Provider not supported");
    }

  const module = require(provider.libName);
    providersToLoad[provider.tag] = new module(ncConfig.configPath);
  });
}

Actual Behavior

The current NodeCloud base-provider.js isn't compatible with NodeCLoud-Azure-Plugin, It throws error each and every time I try to start nodecloud-web

The below snippet of code is buggy and it throws error

/**

  • Returns requested provider type
  • @param {Object} {provider - Type of provider - can be found here '/aws/provider'}
    */
    getProviders(options) {
    if (ncConfig === undefined) {
    throw new Error(
    "Provider config file not found. Please create a config file in project root."
    );
    }
let providersToLoad = {};

if (option && options.hasOwnProperty("overrideProviders")) {
  ncConfig.map(provider => {
    const module = provider.plugin;
    providersToLoad[provider.tag] = module(provider.configPath);
  });
} else {
  ncConfig.map(provider => {
    if (!validProviders.includes(provider.name)) {
      throw new Error("Provider not supported");
    }

    const module = provider.plugin;
    providersToLoad[provider.tag] = module(provider.configPath);
  });
}

return providersToLoad;

}

node1
A screenshot of existing code and error

Steps to Reproduce the Problem

Follow Nodecloud-web installation guide
https://github.com/cloudlibz/nodecloud-web

Specifications

  • Version:
  • Platform: Windows 10
  • Subsystem: node v10.16.2

Structuring the project as a monorepo using Lerna

[GENERATOR] Create SDK parser for Aliyun code generation tool

Describe the solution you'd like

  • Parsing the type definition files of the Aliyun V2 SDK

Additional Information

  • Generate the annotated AST of the required methods from type definition files

Impact

  • NodeCloud codegen module update, addition of a parser

Linked PR: #138

[GENERATOR] Create Transformer for Aliyun code generation tool

Describe the solution you'd like

  • AST traversal to apply transformations to fill out the
    dummy classes
  • Apply relevant transformations such as adding functions,
    parameters for the corresponding functions, and comments for
    the same in the auto-generated classes

Impact

  • updates the code generation module of NodeCloud

Linked PR: #139

[GENERATOR] Create generator for Aliyun code generation tool

Describe the solution you'd like

  • Implement the generator by using parser and transformer implemented.
  • Apply transformations of identifier addition, method param addition and comment addition.

Impact

  • updates the NodeCloud code generation module.

Linked PR: #139

[TOOLING] Addition of ESLint and prettier configuration

Describe the solution you'd like

Addition of ESLint (as static code analyser) and prettier (to enforce code styles via a configuration file) .

Additional information

Currently, the code base does not employ any methods for standardising code quality and consistency across multiple contributors. This can be achieved via the addition of ESLint and prettier respectively. This will completely remove changes that do not pertain to changes in logic across PRs. This issue was apparent because my existing prettier config in vscode was in conflict with the existing code practices in NodeCloud and even a minor change went ahead and formatted the entire file, this will reduce the readability for project maintainers in pull requests.

Impact

Adds a default coding style and removes unnecessary changes in code in multiple PRs across multiple contributors. For example, switching between single and double quotes across multiple PRs in the same code segment. Additionally, the formatter used currently is pretty-quick with no configuration file present, because of this #109 is required, although this is not feasible as the number of contributors in the project increases and should be automated before a commit. Additionally, best practices should be enforced via the use ESLint which can be updated as required via a config file.

Attaching instances of apparent inconsistencies

References

  • misconfiguration of the formatter
    In each commit, the pretty-quick script is run by husky, and this takes the default config of prettier set in the user's vscode, due to this an entire file gets formatted even when there is no major change in it, makes the process of reviewing changes difficult.

  • conflicting single/double quote and trailing comma rules
    Screenshot from 2022-04-13 23-32-41

  • Additional conflicting linting rules with respect to imports, implicit any types and empty function definitions, all these are sources of potential bugs in future and can be avoided by using eslint and enforcing consistent practices.
    Screenshot from 2022-04-13 23-48-28

getProviders() - Wrong Function in README.md

Expected Behavior

FIX: #5
We Expected to see the successful working of npm start, after setting up an app with nodecloud module

Actual Behavior

troi

Steps to Reproduce the Problem

1.Make a new nodeJS project by npm init
2. Inside your package.json, add nodecloud module "dependencies": { "nodecloud": "^0.1.0" }
3. Install dependencies bynpm install
4. Get a GCP key (link is given on the https://github.com/cloudlibz/nodecloud-gcp-plugin), download the key.json file and place it into your root folder.
4.In your server.js (or your mainjsfile.js), include nodecloud module by typing in:

const nodeCloud = require("nodecloud");
// AWS
const gcpProviders = nodeCloud.getProviders('google', 'dronesym-app-ceabf26a2a7e.json');
const options = {
  apiVersion: "2016-11-15"
};
console.log(gcpProvider);

  1. Create a .nc.config.js file containing the code
const providers = [
    {
        name: 'google',
        tag: 'google',
        libName: 'nodecloud-gcp-plugin',
        configFile: {
            projectId: "<your project ID>", //most probably will be "dronesym-app"
            keyFilename: "<path to your GCP Key JSON file>"
//GCP gives you the download of a pre-built key JSON file
        }
    },
    // other providers might be included here
]

module.exports = providers; 
  1. Run the code by going into the terminal, running node <yourfile>.js
  2. Meet the error!

===x===

How we found this error?

Me and @TheLukaszNs were discussing nodecloud related stuff on the gitter channel, When we both noticed an error on the same time, the code was simple, it just had to console.log(getProvider);
But changing getProvider() to getProviders() (as mentioned in readme.MD) would stop our code execution giving the above error. I've provided a fix for this^

[CONFIG] update generator config file

Describe the solution you'd like

  • Update the generator config file that specifies the services to be parsed from the linked SDK to include services from the Aliyun V2 wrapper SDK.

Impact

  • Updates the NodeCloud generator module interface

Linked PR: #141

[GENERATOR] Initialize NodeCloud Aliyun Plugin

Describe the solution you'd like

  • Creating the Aliyun plugin using the created Aliyun generator
  • Add Aliyun into the monorepo structure to automate builds and testing of the package with the entire project

Impact

  • Creates the NodeCloud Aliyun plugin

Linked PR: #140 #141

Creating a prettier Github action

image

Welcome to NodeCloud with Hacktoberfest 2020!

Stay in the know: Get notified of updates by clicking the πŸ‘β€πŸ—¨ watch button and save the repository for later reference by clicking the ⭐️ star button at the top right corner of this repo!

Creating a prettier Github action

Prettier is a very popular code formatter to format your code and prevent the ongoing debates about code styles. Currently, prettier is triggered through a pre-commit hook (husky) which will run Prettier on the staged files prior to committing.

This works well in most cases, but there are certain cases where the code might not be formatted:

  • Running git commit --no-verify will commit code without running pre-commit hooks which can result in files not being formatted.

  • Pre-commit hook (husky) is not properly installed in the developers local machine.

To automate this process you can use git auto-commit action to run prettier and commit the changes if necessary. Check out the references to get started πŸš€!

Additional information

  • The project currently contains two main branches: master and nodecloud-next. This feature is required to the nodecloud-next branch. so make sure that you create the feature branch from nodecloud-next.

nodecloud-next: https://github.com/leopardslab/nodecloud/tree/nodecloud-next

Impact

  • Github workflows directory

References

Nodecloud NPM version is not being updated

The package version of nodecloud hasn't been updated since its creation - that makes some mess around documentation, as the code shown in documentation is newer than what we can use with NPM module!

Owner of this NPM package should bump the version to update the module πŸ”

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.