Our bin executables currently reference the tsc compiled cli.ts -> cli.js file. However, Typescript does not maintain the files' runtime permissions and resets them to the least amount of privileges.
To work around this, we introduced an npm script that runs after the build process to provide the generated cli.js file with its executable permission. However, the issue with this is it's not cross-platform compatible.
Solution:
Instead, we'll have a static bin directory as a sibling to the src and dist folders. This bin directory will need to be published along with Spectral. This bin folder will contain executable files that reference their corresponding CLI functionality.
Issue:
Our
bin
executables currently reference the tsc compiledcli.ts -> cli.js
file. However, Typescript does not maintain the files' runtime permissions and resets them to the least amount of privileges.The configuration for this is:
To work around this, we introduced an npm script that runs after the build process to provide the generated
cli.js
file with its executable permission. However, the issue with this is it's not cross-platform compatible.Solution:
Instead, we'll have a static
bin
directory as a sibling to thesrc
anddist
folders. Thisbin
directory will need to be published along with Spectral. Thisbin
folder will contain executable files that reference their corresponding CLI functionality.Current Issue in Microsoft TypeScript Github repository: https://github.com/Microsoft/TypeScript/issues/26060.