Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
    Elad Ben-Israel
    @eladb
    Hello!
    Simon
    @stowns
    hi all, I just began using jsii to try and build a cdk lib. I'm having an issue when trying to add a non @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)
    i can confirm that the module is listed in both dependencies and peerDependencies as well as installed to the node_modules dir
    any idea why it may be unable to locate it?
    cdk 1.21.1 with "jsii": "^0.21.1" and node v10.16.3
    Elad Ben-Israel
    @eladb
    You will need to bundle it by specifying “bundledDependnecies” in your package.json
    @RomainMuller is this documented somewhere?
    Romain Marcadier-Muller
    @RomainMuller
    I think it is but let me double check that
    Simon
    @stowns
    ah yes that is here https://github.com/aws/jsii/blob/fc366d0a461473e1e6caeb85117098c708d191da/docs/configuration.md under 'Dependencies that are not jsii modules'
    Simon
    @stowns
    are there any jsii-pacmak rules against re-exporting an interface from the main 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)
    my index.ts has
    import { MLOpsCfg } from './cfg';
    export { MLOpsCfg } from './cfg';
    Simon
    @stowns
    i refactored and pulled all of the .cfg interfaces into index.ts and exported them directly and it seems to be happy w/ that
    Matthew Bonig
    @mbonig
    I'm trying to create a JSII construct that has an interface like this:
    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;
        }
    
    }
    however, when I jsii build the package I get this error:
    error TS9999: JSII: Only string index maps are supported
    Is there a simple change I can make to support this shape of my interface or would I need to flatten those fields?
    Elad Ben-Israel
    @eladb
    You’ll have to define the inner type as a separate interface
    Matthew Bonig
    @mbonig
    @eladb :thumbsup:
    Daniel Schroeder
    @udondan
    i could use a pointer how to add js assets to my jsii package. i have a 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?
    i guess i could add a build step and zip the content up and then use the zip as my lambda source instead of the directory