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
fix: correctly link types in package.json
exports
field
#1395
Conversation
This pull request is automatically built and testable in CodeSandbox. To see build info of the built libraries, click here or the icon next to each commit SHA. Latest deployment of this branch, based on commit 702147f:
|
I'm not sure what to do about the failing tests.. Older versions don't have "Node16" as an option |
Looks like we need a way to run ProposalLet's add support for To achieve this, we can move the typings tests logic into a custom script. // test/typings/run.ts
import * as fs from 'fs'
import * as path from 'path'
import { spawnSync } from 'child_process'
import { invariant } from 'outvariant'
import tsPackageJson from 'typescript/package.json'
const tsVersion = tsPackageJson.version
invariant(tsVersion, 'Failed to run typings tests: unable to determine TypeScript version')
const tsConfigPaths = [
path.resolve(__dirname, `tsconfig.${tsVersion}.json`),
path.resolve(__dirname, 'tsconfig.json')
]
const tsConfigPath = tsConfigPaths.find((path) => fs.existsSync(path))
spawnSync('yarn', ['test:ts', tsConfigPath], {
cwd: path.resolve(__dirname, '../..')
}) Then, you'd be able to create custom TS configurations for targets 4.2 - 4.6. There'd be no need to repeat yourself as we can write a single "old" config and use it for other compatible targets: // tsconfig.4.4.json
{
"extends": "tsconfig.4.2.json"
} @ivanhofer, does this sound interesting to you? Or do you want me to add this once I have time? |
I have some free time next week. I can take a look at this |
Thank you! Don't hesitate to ping me in this thread for any help. Excited for this. |
@kettanaito I have fixed the tests like you have suggested. I had to add |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I simply love these automations! 😍
Thank you so much for fixing the issue and improving our testing setup, @ivanhofer.
Let's wait for the build status and merge this.
Released: v0.47.4 🎉This has been released in v0.47.4! Make sure to always update to the latest version ( Predictable release automation by @ossjs/release. |
Fixes an issue where type annotations would be broken on Node 16 (TS 4.7-4.8).