Code Monkey home page Code Monkey logo

Comments (12)

eladb avatar eladb commented on May 28, 2024

Sounds good. Should be fairly easy to support. Contributions are welcome

from projen.

pgollucci avatar pgollucci commented on May 28, 2024

Does it make sense to pass srcDirs for each component in the rc or should the construct pass srcDirs to all components for you ?

from projen.

Chriscbr avatar Chriscbr commented on May 28, 2024

I think passing srcDirs to all relevant subcomponents for you would be a sensible default - but it should still be possible to override the choices on an per-component basis (e.g. if you don't want to lint a folder that has legacy code, but you still want to compile/build it). Overriding per-component srcdirs should probably through directly assigning to certain fields or calling an API.

Perhaps we could change the srcdir option/param to be an array of strings instead (or add a srcdirs flag and deprecate srcdir)? This might require changes in several places - but the endgoal though is to represent a simpler / more flexible mental model. If a specific project type like a CDK app requires there to be only one source directory, then a runtime check could be added to the constructor to validate that the srcDirs list is length 1.

from projen.

github-actions avatar github-actions commented on May 28, 2024

This issue is now marked as stale because it hasn't seen activity for a while. Add a comment or it will be closed soon.

from projen.

eladb avatar eladb commented on May 28, 2024

Don't close

from projen.

github-actions avatar github-actions commented on May 28, 2024

Closing this issue as it hasn't seen activity for a while. Please add a comment @mentioning a maintainer to reopen.

from projen.

Chriscbr avatar Chriscbr commented on May 28, 2024

Reopening. This is a currently an issue since cdk8s projects (created with projen new cdk8s-app-ts) cannot use any cdk8s imports they generate, since the src and imports directories are separate and the generated tsconfig.json has rootDir set to src.

A temporary workaround for the above issue is to use an escape hatch:

project.tryFindObjectFile('tsconfig.json').addDeletionOverride('compilerOptions.rootDir');

from projen.

Chriscbr avatar Chriscbr commented on May 28, 2024

For JSII projects (like construct libraries), the above workaround doesn't work since tsconfig.json is managed/generated by jsii. But today I realized that JSII actually does support multiple source directories, it just requires that "rootDir" option in JSII's typescript options has to be left empty! source:

https://github.com/aws/jsii/blob/2120d34ef74597a6c7995e7798947a6fc931df04/packages/jsii/lib/compiler.ts#L314

So a workaround for JSII projects is:

project.tryFindObjectFile('package.json').addDeletionOverride('jsii.tsc.rootDir');

Edit: Actually I guess this only does a little bit since you still need a single root of your project with an index.ts file, otherwise JSII starts to complain.

(Somewhat relatedly, JsiiProject has a rootdir option which doesn't do anything...)

from projen.

github-actions avatar github-actions commented on May 28, 2024

This issue is now marked as stale because it hasn't seen activity for a while. Add a comment or it will be closed soon.

from projen.

github-actions avatar github-actions commented on May 28, 2024

Closing this issue as it hasn't seen activity for a while. Please add a comment @mentioning a maintainer to reopen.

from projen.

github-actions avatar github-actions commented on May 28, 2024

This issue is now marked as stale because it hasn't seen activity for a while. Add a comment or it will be closed soon. If you wish to exclude this issue from being marked as stale, add the "backlog" label.

from projen.

github-actions avatar github-actions commented on May 28, 2024

Closing this issue as it hasn't seen activity for a while. Please add a comment @mentioning a maintainer to reopen. If you wish to exclude this issue from being marked as stale, add the "backlog" label.

from projen.

Related Issues (20)

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.