Git Product home page Git Product logo

cdkdx's People

Contributors

dependabot[bot] avatar hupe1980 avatar krotki avatar markusl avatar rayou 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

Watchers

 avatar  avatar  avatar

cdkdx's Issues

Ability to modify default tsconfig.json which is added in /src/lambdas

It would be nice, if the configuration would allow some overwrites to the tsconfig.json which is applied to the lambda bundling.
For example, we are trying to use inverisfy.js inside the lambdas for dependency injection. For that to work, we would need to set the following properties:

{
  "compilerOptions": {
    "emitDecoratorMetaData": true,
    "experimentalDecorators": true
  }
}

I would suggest, the following changes:

  • Introduce two new optinal files: tsconfig.lambdas.json and tsconfig.cdk.json (or any other names to distinguish)
  • If those files exist, the project info picks them up so it can be later merged into the default default config file before beeing generated

If you like lets start a small discussion over this topic, potential problems or improvements.
I would be happy to contribute to this awesome project by implementing those ideas.

Greetings
Viktor

Compile issues using newer NPM

This issue seems to be deep inside of libnpmpack, specifically const destination = path.resolve(opts.packDestination, filename) on line 43 of lib/index.js. opts.packDestination is undefined. Adding a ?? "" fixes my issue locally.```

➤ YN0000: [@ldk/pipelines]: Error: Command (npm pack "/home/runner/work/ldk-pipelines/ldk-pipelines/packages/@ldk/pipelines") failed with status 1:
➤ YN0000: [@ldk/pipelines]: #STDERR> npm ERR! code ERR_INVALID_ARG_TYPE
➤ YN0000: [@ldk/pipelines]: #STDERR> npm ERR! The "path" argument must be of type string. Received undefined
➤ YN0000: [@ldk/pipelines]: #STDERR>
➤ YN0000: [@ldk/pipelines]: #STDERR> npm ERR! A complete log of this run can be found in:
➤ YN0000: [@ldk/pipelines]: #STDERR> npm ERR! /home/runner/.npm/_logs/2022-03-22T04_51_05_023Z-debug.log
➤ YN0000: [@ldk/pipelines]: #STDERR>
➤ YN0000: [@ldk/pipelines]: #STDOUT>
➤ YN0000: [@ldk/pipelines]: at ChildProcess. (/home/runner/work/ldk-pipelines/ldk-pipelines/node_modules/jsii-pacmak/lib/util.js:178:27)
➤ YN0000: [@ldk/pipelines]: at Object.onceWrapper (node:events:640:26)
➤ YN0000: [@ldk/pipelines]: at ChildProcess.emit (node:events:520:28)
➤ YN0000: [@ldk/pipelines]: at maybeClose (node:internal/child_process:1092:16)
➤ YN0000: [@ldk/pipelines]: at Process.ChildProcess._handle.onexit (node:internal/child_process:302:5)

cdk 2

has a migration to cdk 2.* begun? just wondering if someone has done the leg work before i dig in ;)

thx, j

Error: The "package.json" file must specify the "repository" attribute

It seems repository attribute is missing in package.json for jsii lib template, please see error below:

$ npx cdkdx build

 demo/index.js ⏤  1.18 kB (+1.18 kB)

 DONE  Compiled successfully in 3587ms                                                                                                              2:43:32 pm

Internal Error: Command failed with exit code 255: /Users/ray.ou/Repository/my-jsii-construct/node_modules/jsii/bin/jsii --project-references --silence-warnings=reserved-word
Error: Error: The "package.json" file must specify the "repository" attribute

After added repository attribute to package.json, the project is successfully built.

  // Add this to package.json
  "repository": {
    "type": "git",
    "url": "https://github.com/rayou/test.git"
  },
$ npx cdkdx build

 demo/index.js ⏤  1.18 kB

 DONE  Compiled successfully in 2253ms                                                                                                              2:56:20 pm

 DONE  Project my-jsii-construct compiled in 9.336ms.

Deployed lambdas contain ts files rather than js

I'm using the latest version of cdkdx (1.1.0) and cdk (1.123.0).

When I deploy a stack I see that the lambda is built in the output, e.g.

hello-world/index.js ⏤ 1.32 kB

But the asset folder under cdk.out only contains the index.ts file. Once deployed, the same files are visible in the code source on the lambda console and when testing I get the error message of "index.handler is undefined or not exported

I can find index.js locally under lib, and I was expecting this to be in the cdk.out asset folder and also uploaded.

Am I missing something obvious?

[eslint-plugin-cdk/rules/ban-lambda-runtimes] doesn't work if I rename the import

Cause

node.superClass.object.name === 'cdk' &&

This line of code ⬆️ enforces we use the name cdk to import "all" from aws-cdk-lib.

e.g.

import * as cdk from "aws-cdk-lib" // ✅ works!
import * as Cdk from "aws-cdk-lib" // ❌ doesn't work!

Reason

You might be curious why I would wanna use other import names like Cdk.
Well, let's take a look at React:

// 😌
import * as React from "react"
<React.Fragment />
React.useState()

// 🥴
import * as react from "react"
<react.Fragment />
react.useState()

From the above example, we can see that capitalizing the name of import "all" makes more sense.

Workaround

- node.superClass.object.name === 'cdk' &&
+ node.superClass.object.name.toLowerCase() === 'cdk' &&

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.