hupe1980 / cdkdx Goto Github PK
View Code? Open in Web Editor NEWZero-config CLI for aws cdk development
License: MIT License
Zero-config CLI for aws cdk development
License: MIT License
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:
tsconfig.lambdas.json
and tsconfig.cdk.json
(or any other names to distinguish)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
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)
has a migration to cdk 2.* begun? just wondering if someone has done the leg work before i dig in ;)
thx, j
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.
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?
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!
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.
import { Stack } from "aws-cdk-lib"
, or[email protected]
with ⬇️- node.superClass.object.name === 'cdk' &&
+ node.superClass.object.name.toLowerCase() === 'cdk' &&
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.