Skip to content

Conversation

@Eric162
Copy link

@Eric162 Eric162 commented Aug 31, 2023

Fixes #55

Basically the types output was incorrect, pointing to the source index.ts rather than the build types file.

@agoldis
Copy link
Contributor

agoldis commented Aug 31, 2023

@Eric162 when publishing package.json is modified when published by https://github.com/currents-dev/cypress-debugger/blob/main/packages/support/publish.js - are you still experiencing issues with types?

@Eric162
Copy link
Author

Eric162 commented Aug 31, 2023

@agoldis I see. Let me take a closer look at that.

But yes, i am still seeing issues - in the package.json of the version I have it looks like so:

{ "name": "@currents/cypress-debugger-plugin", "version": "1.0.7", "main": "./dist/index.js", "types": "./src/index.ts", "license": "GPL-3.0-or-later", "scripts": { "build": "tsup-node", "dev": "tsup --watch", "lint": "eslint src --fix", "publish-npm": "node ./publish.js", "test": "jest" }, "keywords": [ "cypress", "e2e", "cypress-debugger", "currents", "cypress-replay", "cypress-traces", "replay", "sorry-cypress", "time-travel" ], "files": [ "dist", "LICENSE.md" ], "devDependencies": { "@types/chrome-remote-interface": "^0.31.9", "@types/debug": "^4.1.7", "tsconfig": "*", "tsup": "^6.6.3", "typescript": "^5.1.6" }, "dependencies": { "@currents/cypress-debugger-support": "*", "@neuralegion/cypress-har-generator": "^5.16.4", "chrome-remote-interface": "^0.32.1", "debug": "^4.3.4" } }
@Eric162
Copy link
Author

Eric162 commented Aug 31, 2023

Looks like the "exports" field only exists in the dist folder

the previous json i posted was from
node_modules/@currents/cypress-debugger-plugin/package.json VS
node_modules/@currents/cypress-debugger-plugin/dist/package.json :

{ "name": "@currents/cypress-debugger-plugin", "version": "1.0.7", "main": "./dist/index.js", "license": "GPL-3.0-or-later", "scripts": { "build": "tsup-node", "dev": "tsup --watch", "lint": "eslint src --fix", "publish-npm": "node ./publish.js", "test": "jest" }, "keywords": [ "cypress", "e2e", "cypress-debugger", "currents", "cypress-replay", "cypress-traces", "replay", "sorry-cypress", "time-travel" ], "files": [ "*" ], "devDependencies": { "@types/chrome-remote-interface": "^0.31.9", "@types/debug": "^4.1.7", "tsconfig": "*", "tsup": "^6.6.3", "typescript": "^5.1.6" }, "dependencies": { "@currents/cypress-debugger-support": "*", "@neuralegion/cypress-har-generator": "^5.16.4", "chrome-remote-interface": "^0.32.1", "debug": "^4.3.4" }, "exports": { ".": { "import": "./index.mjs", "require": "./index.js", "types": "./index.d.ts" } } }
@Eric162
Copy link
Author

Eric162 commented Aug 31, 2023

One note is - we are not importing these packages directly (and don't really want to) - we are trying to use the types through the overall cypress-debugger package, but that package seems to point to the overall package.json rather than the dist folder's package.json, and so the types don't come through for us.

@Eric162
Copy link
Author

Eric162 commented Aug 31, 2023

maybe this

https://github.com/currents-dev/cypress-debugger/blob/main/packages/cypress-debugger/index.ts#L4-L5

would need to point to /dist ? trying some stuff locally to see

@agoldis
Copy link
Contributor

agoldis commented Sep 5, 2023

@Eric162 Thanks for investing your time into that issue. The build/release process is a bit awkward, but I was able to fix it on main - version 1.0.9 has types exported correctly.

@agoldis agoldis closed this Sep 5, 2023
@Eric162 Eric162 deleted the fix-plugin-types branch September 5, 2023 18:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

2 participants