@aws-cdk
dependency. I'm able to add additional aws deps like @aws-cdk/aws-codepipeline
but if I add js-yaml
lodash
etc project-info.js
throws an Error: Error: Unable to locate module:
Error: Error: Unable to locate module: lodash
at _tryResolveAssembly (/Users/townsimo/dev/cdk-ml-pipeline/ml-ops-lib/node_modules/jsii/lib/project-info.js:201:15)
at _loadDependencies (/Users/townsimo/dev/cdk-ml-pipeline/ml-ops-lib/node_modules/jsii/lib/project-info.js:126:21)
cdk 1.21.1
with "jsii": "^0.21.1"
and node v10.16.3
index.ts
class? I have a cfg.ts
where i define various interfaces and i'd like it to be available for import from my library ie import { SomeCfg } from 'my-lib'
but I'm getting a pacmak error on npm run package
Error: Cannot find type 'aws-ml-ops.MLOpsCfg' either as internal or external type at PythonGenerator.findType (.../aws-ml-ops/node_modules/jsii-pacmak/lib/generator.js:391:19)
import { MLOpsCfg } from './cfg';
export { MLOpsCfg } from './cfg';
export interface CicdSpaWebsiteProps extends StackProps {
/**
* a limited schema version of GitHubSourceActionProps
*/
readonly githubSource: {
/**
* The GitHub account/user that owns the repo.
*/
"owner": string;
/**
* The name of the repo, without the username.
*/
"repo": string;
/**
* The branch to use.
*
* @default "master"
*/
"branch"?: string;
/**
* A GitHub OAuth token to use for authentication.
*
* It is recommended to use a Secrets Manager `Secret` to obtain the token:
*
* const oauth = cdk.SecretValue.secretsManager('my-github-token');
* new GitHubSource(this, 'GitHubAction', { oauthToken: oauth, ... });
*/
"oauthToken": SecretValue;
}
}
lambda/index.ts
which i would like to include in the package. the built packages though do not include the lambda directory. i looked at the cdk packages and found examples there, e.g. https://github.com/aws/aws-cdk/tree/c7197c0048474f69e253b752e289abad6e72554f/packages/%40aws-cdk/aws-s3-deployment - this seems to only work because the lambda function is written in python. how can i add a ts/js based lambda to my package?
python setup.py install
. I'm using pycharm and can see the package acme.hello-jsii in the interpreter but cannot get my import statement to resolve. I do see the .egg file in .virtualenvs/myenv/lib/python3.6/site-packages . What exactly should my import statement be?
Hi All, I am currently experimenting with jsii. My basic idea is to provide interop for Golang and NodeJs in order to call functions form Readability JS library (https://github.com/mozilla/readability) via Golang. To do that, I wrapped Readability JS into tiny Typescript file. Currently, when I run npx jsii
I got compilation errors
node_modules/@mozilla/readability/index.d.ts:6:13 - error TS2304: Cannot find name 'Document'.
6 document: Document,
The same goes for jsdom
library. I am fairly new to modern Javascript/Typescript setup I might be doing something wrong regarding this. Or maybe my idea is even impossible to cover with jsii. Could someone help me understand that? Thanks a lot 🙏
Noticing it doesnt look like there are many responses around here.. but going to shoot my question out there with some hope anyway.
I am trying to convert an existing TS lib to JSII. The lib is an SDK for a YAML schema model. There was a base abstract class component
which is now a behavioral interface IComponent
.
All "components" will have a generate()
function which will return an object with some schema specific to that object. The issue is JSII will not allow me to override this function in extending classes.
export interface IComponent {
generate(): unknown
}
export interface ICommand extends IComponent {
name: string;
generate(): {
someValue: string
}
}
export class MyCommand implements ICommand {
name = "MyCommand"
generate() {
return {someValue: "test"}
}
}
const ComponentArray: IComponent[] = []
This will result in:
Interface "jsii-testing.ICommand" re-declares member "generate". This is not supported as it results in invalid C#.
What is the proper way to approach this?