Giter Club home page Giter Club logo

panacloud / cli Goto Github PK

View Code? Open in Web Editor NEW
25.0 25.0 6.0 8.08 MB

Panacloud Command Line Interface (CLI) uses the design-first approach for developing APIs. It generates Modern Multi-Tenant Serverless Cloud API infrastructure, mocks, stubs, tests, and stages using CDK. GraphQL schemas and OpenAPI specifications are used to implement the design-first approach.

JavaScript 0.28% Batchfile 0.01% TypeScript 95.17% HTML 4.55%
aws cdk graphql openapi serverless

cli's People

Contributors

aamir1995 avatar abdulrafayghani avatar adil-innovation-lab avatar mateen7861 avatar muh-hasan avatar muhammadmohsin avatar murtazahuzaifa avatar shariqanwar20 avatar tanzeeltasleem avatar uzairbangee avatar warishasan avatar ziaukhan 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

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

cli's Issues

Types Error on Dev Deployment

Steps to reproduce:

  1. create a new project with panacloud init.
  2. use the userschema from tutorial00-getting-started-graphql dir.
  3. deploy the project with npm run deploy-dev, this will now throw an error.

image

OpenAPI Support

Hey! I see you've got OpenAPI on the roadmap, I'm just putting this issue here so I can get an update when it's done.

I'll be happy to talk to you about getting up on https://openapi.tools and other directories so our community can find you, and maybe can write a few blog posts so the community are even more aware of what you're up to here. It looks interesting. ๐Ÿ™Œ๐Ÿป

Add Custom Constructs

Currently, if a developer wants to add custom constructs to the generated stack, he/she will have to add a visitor aspect. Some developers might find understanding aspects difficult. Therefore, it might be nice to add a file editable_src/CustomConstructs/AddConstructs.ts which has a method AddConstruct with a stack object as a parameter. In this method, the developer can easily add constructs to the stack. This method will be called before the aspects are called.

Property 'fields' of exported interface has or is using private name 'Id'

I have just added a plain todoSchema, and initialize the project. Right after that run the build command npm run build, and the following type errors came.
Property 'fields' of exported interface has or is using private name 'Id'

The file named testCollectionsTypes.ts contains the code:

import {
  Todo,
  MutationAddTodoArgs,
  MutationUpdateTodoArgs,
  MutationDeleteTodoArgs,
} from "../types";

export type TestCollection = {
  fields: { deleteTodo: { arguments: MutationDeleteTodoArgs; response: Id }[] };
};

The errors in command line were

mock_lambda_layer/mockData/deleteTodo/testCollectionsTypes.ts:9:72 - error TS2304: Cannot find name 'Id'.

9   fields: { deleteTodo: { arguments: MutationDeleteTodoArgs; response: Id }[] };
                                                                         ~~

mock_lambda_layer/mockData/deleteTodo/testCollectionsTypes.ts:9:72 - error TS4033: Property 'fields' of exported interface has or is using private name 'Id'.

9   fields: { deleteTodo: { arguments: MutationDeleteTodoArgs; response: Id }[] };

image

commands `panacloud client` and `panacloud status` throws an error.

Current Behavior:

commands panacloud client and panacloud status looks for ./editable_src/panacloudConfig.json instead of ./editable_src/panacloudconfig.json.
image

Expected Behavior:

  • The command panacloud client should open GraphiQL browser instance successfully.
  • panacloud stauts should output schema/config status as expected.

Steps to reproduce:

  1. Create a new project with panacloud init with a default schema.
  2. Deploy the sample project with command npm run deploy-dev.
  3. Try to open the GraphiQL instance by running panacloud client <-- this throws an error at the moment.

Making it easy to move from mocks to lambda stubs

We want the API developer to easily config the lambda stubs. Our panacloudconfig.json should look like this:

{
"lambdas": {
"user": { "is_mock": true },
"addUser": { "is_mock": true }
},
"stages": ["prd", "dev"]
}

There are only two states of lambdas either we are using the mock lambdas (custom test data) or stub lambdas (custom business logic) for the real lambdas.

When the is_mock is true we will be using the mock_lambda and mock_lambda_layer. But the mock data will be in a separate directory editable_src/mockData. The types of this mockData will be in a directory testCollectionsTypes in the root, it will be updated by the update cli command. However, editable_src/mockData will not be updated by the cli but the developer will be responsible for maintaining and updating it. This editable_src/mockData will be used to create the mock server on the server-side and test the API on the client-side. When the mock lambdas are being deployed the editable_src/mockData directory will be copied to the mock_lambda_layer.

When the is_mock is false we will be using the editable_src/lambda_stubs and editable_src/lambdaLayers for real lambdas. The editable_src/mockData will not be used on the server-side but only on the client-side to test the APIs.

CLI: `deploy-prd` deploys resources from `mock_lambdas` even if I change `panacloudconfig.json`

Current Behavior:

running npm run deploy-prd seems to be deploying mock lambdas from mock_lambda directory, even if you change the pancloudconfig.json and run panacloud update.

screenshot from AWS console showing deployed mock_lambda
image

Steps to reproduce:

  1. create a new project with panacloud init.
  2. use the todo schema from tutorial003 dir.
  3. deploy the project with npm run deploy-prd. // <-- the project will deploy the mock_lambdas instead of lambds_stubs.
  4. now edit the panacloudconfig and provide real lambda path and run panacloud update, deploy the project again with npm run deploy_prd // <--- this will now throw an error.
    image

Shifting from Yellicode to Codemaker

Constructs:

  • Constructs Imports
  • Cdk
  • Appsync
  • Ec2
  • ApiManger
  • Apigateway
  • DynamoDB
  • Iam
  • Neptune
  • Lambda
  • AuroraServerless

Code Generators:

  • Testing
  • Appsync
  • Apigateway
  • DynamoDB
  • Bin
  • Stack
  • Lambda
  • Neptune
  • AuroraServerless
  • LambdaConstruct

  • Fixes

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.