Open amunrarara opened 5 months ago
package.json for posterity:
{
"name": "@amunrarara/nostr-hooks",
"version": "2.6.3",
"description": "React hooks for developing Nostr clients.",
"main": "dist/index.js",
"module": "dist/index.js",
"types": "dist/index.d.ts",
"repository": {
"type": "git",
"url": "https://github.com/amunrarara/nostr-hooks.git"
},
"files": [
"./dist/*/"
],
"funding": [
"https://getalby.com/p/sepehr"
],
"exports": {
".": {
"import": "./dist/index.js"
},
"./package.json": "./package.json"
},
"scripts": {
"build": "tsc",
"test": "jest",
"format": "prettier --write .",
"prepare": "npm run build",
"prepublishOnly": "npm run build"
},
"jest": {
"rootDir": ".",
"preset": "ts-jest/presets/default-esm",
"testEnvironment": "jsdom",
"transform": {
"^.+\.(t|j)sx?$": [
"ts-jest",
{
"useESM": true
}
]
},
"extensionsToTreatAsEsm": [
".ts",
".tsx"
],
"moduleNameMapper": {
"^nostr-hooks$": "
Is there, perhaps, some limited folder depth in which yalc defaults?
I'm totally unsure why the wildcard resolutions are not working. I did kind of resolve the issue by removing the "files" directive in package.json
. However, now the entire project is present in the yalc store.
"files": [
"./dist/**/*"
],
Can anyone explain what's wrong with this wildcard?
I believe the wildcard needs to be /dist/**/*
, not ./dist/**/*
. I haven't found an authorative reason as to why, but it solved the same problem in my case.
When using
yalc publish
, the output within the~/.yalc/packages/
directory is missing almost everything that's in the project'sdist
folder; the only thing in there isindex.js
which has a single import statement, meant to start off several rounds of imports through 'bucket-export' files (files that are only used to export other files).Running
npm publish
properly publishes the entire package to npm's registry, though, so it seems there's something funny happening withyalc
.Any guidance would be greatly appreciated, thank you!
NPM v20.10.0
Steps to reproduce:
dist/
directory in my npm registry deployment for that library: https://www.npmjs.com/package/@amunrarara/nostr-hooks?activeTab=codedist/
found at~/.yalc/packages/@amunrarara/nostr-hooks/2.6.3
, which only containsindex.js
and nothing else.Note that I updated my own copy's package.json name field to be
@amunrara/nostr-hooks