index.js and index.d.ts files are getting ignored when building a tarball
mcve
deno.json
{
"name": "@foo/bar",
"version": "1.0.0",
"exports": {
".": "./index.js"
}
}
index.js
export const foo = 123
index.d.ts
export const foo: number
expected result
the tarball gets built and published correctly
actual result
the --dry-run output doesn't include these files:
Simulating publish of @foo/[email protected] with files:
file:///path/to/LICENSE (1.04KB)
file:///path/to/deno.json (88B)
Warning Aborting due to --dry-run
and actual publish errors out due to index.js not being present (linefeed for readability):
Failed to publish @foo/bar at 1.0.0: invalid 'exports' field in config file '/deno.json':
export '.' references entrypoint '/index.js' which does not exist
Do you have a .gitignore?
i do.. thanks
though it is pretty unexpected that it's getting in the way, especially considering that
- i initially had
excludes in deno.json, which i would expect to override gitignore instead of adding on top of it (like .npmignore does) - i had it somewhere in parent directories, not in the package directly
maybe error could be improved when an entrypoint is ignored by gitignore (or anything else)?
Thanks for the feedback. The docs mention that exclude is stacked on .gitignore (https://jsr.io/docs/publishing-packages#filtering-files). This is done to reduce the amount of places one has to write the same ignore rules (for things like .env).
We do have docs for the exact scenario you ran into: https://jsr.io/docs/publishing-packages#un-gitignoring-files-when-not-using-include.
We can certainly improve the error messages here - @dsherret I thought we already errored in this case. Do you know why we are not?
Duplicate of #289