Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Concept of Project Setup #172

Open
frank-dspeed opened this issue Feb 23, 2022 · 4 comments
Open

Concept of Project Setup #172

frank-dspeed opened this issue Feb 23, 2022 · 4 comments

Comments

@frank-dspeed
Copy link
Member

Typescript is in general great but needs a lot of configuration from the user see microsoft/TypeScript#33136

creating a tool that does the includes composit d.ts creation as also showing the current state of your deps is getting more and more importent.

  • check and create d.ts from js
  • check typescript resolve modes if they will find types. and list exportConditions if needed.
  • create rollup-plugins/strip-none-type-comments.
  • create rollup-plugins/detect-none-type-comments.
  • create rollup-plugins/detect-type-comments.
  • create JSDOC Type Annotations from .d.ts + JS

Your Typescript project can only have a single resolve algo for its Modules and Types this is contra productiv.

@frank-dspeed
Copy link
Member Author

other solution

{
  "[compilerOptions](https://www.typescriptlang.org/tsconfig#compilerOptions)": {
    "[baseUrl](https://www.typescriptlang.org/tsconfig#baseUrl)": "src",
    "[paths](https://www.typescriptlang.org/tsconfig#paths)": {
        "app/*": ["app/*"],
        "config/*": ["app/_config/*"],
        "environment/*": ["environments/*"],
        "shared/*": ["app/_shared/*"],
        "helpers/*": ["helpers/*"],
        "tests/*": ["tests/*"]
    },
}

today the best solution will be the project references in tsconfig and the composit flag in the dist code of the package.

@frank-dspeed
Copy link
Member Author

lookup files

  • package.json
  • tsconfig.json
  • jsconfig.json

https://www.typescriptlang.org/tsconfig#moduleResolution

@frank-dspeed
Copy link
Member Author

stealify will not use a json it will use a js file as entry that will gen a importMap based on all files and will cache that as json if requested.

@frank-dspeed
Copy link
Member Author

frank-dspeed commented Feb 23, 2022

Best solution

We get full access to the typescript ast while we can not change it which is also not needed for our case we want to give type hints and expose resolve algos.

we use the typescript ast as file emitter for rollup and then return the results and information.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant