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

[build] - public API for build process #163

Closed
rkovalov opened this issue Feb 24, 2021 · 7 comments
Closed

[build] - public API for build process #163

rkovalov opened this issue Feb 24, 2021 · 7 comments

Comments

@rkovalov
Copy link

rkovalov commented Feb 24, 2021

Could u please open API for build, it really helps me to wrap process inside my own build scripts ? WDYT ?:)

move code from ``cli.ts` line 32 to build.ts scripts
https://github.com/AviVahl/ts-tools/blob/main/packages/build/src/cli.ts#L32

@rkovalov rkovalov changed the title [build] - open API for build [build] - public API for build process Feb 24, 2021
@AviVahl
Copy link
Owner

AviVahl commented Feb 24, 2021

As I mentioned in #159, I'm planning to deprecate the @ts-tools/build package. I'm finishing up migrating several repositories still using it to project references, and then it will be retired.
However, feel free to take any piece of useful code from it. It's MIT exactly for this reason. :)

@rkovalov
Copy link
Author

ok, thanks )

@AviVahl AviVahl closed this as completed Feb 25, 2021
@rkovalov
Copy link
Author

@rkovalyov Just to get knowledge, finally Do you expect to run build by tsc --build in project what you migrating to project references?

@AviVahl
Copy link
Owner

AviVahl commented Feb 25, 2021

Yeah, and you can actually see several setups using it here:
https://github.com/wixplosives/sample-monorepo
https://github.com/wixplosives/file-services

@rkovalov
Copy link
Author

@AviVahl How to deal with developing own build scripts (bin) for closing api from other developers, and control it from one repo ?

@AviVahl
Copy link
Owner

AviVahl commented Feb 25, 2021

Not sure I understand what you're asking... Could you clarify what it is you are trying to achieve?
What do you mean by "how to deal", "closing api", and "control it"?

If you need to create a cli, you reference an entry point (with a shebang comment at the top) from the package.json with the "bin" field.
For any npm package, you can also expose whatever you choose as a public API (through the "exports" or "main" fields).
If you're using newer Node versions, you can control which files (internal to your package) can be imported from outside using the "exports" field.
Several npm packages can co-exist in a mono-repo (such as ts-tools), referencing one another, allowing you to control the used APIs and develop packages in parallel. Each of those packages can define bin entries.

@rkovalov
Copy link
Author

rkovalov commented Feb 25, 2021

@AviVahl sorry for my English )
I meant run programatically tsc --build and for example handling css by gulp in one process,

"closing api" - hidden api for other developers
"control it"- wrap all logic related building package in one repo (like create react app scripts)

so finally, instead of concurrently running concurrently "tsc --build" "build css" , wrap all logic in own cli tool and run my-own-scripts build

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

2 participants