-
Notifications
You must be signed in to change notification settings - Fork 222
exclude test build files from packages #2005
Conversation
"!build/*.tsbuildinfo", | ||
"!build/ts/**/*.test.*", | ||
"index.js", |
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 think index.js
get added but default no?
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.
https://docs.npmjs.com/cli/v7/configuring-npm/package-json#files
Unless we are being explicit for clarity.
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.
That's true. Though I'd lean towards keeping it explicit.
"./src/**/*.tsx" | ||
], | ||
"exclude": ["**/*.test.ts", "**/*.test.tsx"] | ||
"include": ["../../config/typescript/*.ts", "./src/**/*.ts", "./src/**/*.tsx"] |
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.
could these go in the base config if most packages follow the same pattern?
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.
LGTM
Annoyingly it seems half of our tests live in folders called |
.eslintignore
Outdated
packages/graphql-config-utilities/src/tests/fixtures/**/*.graphql | ||
packages/graphql-typescript-definitions/test/fixtures/**/*.graphql | ||
packages/graphql-validate-fixtures/test/fixtures/**/*.graphql | ||
packages/graphql-config-utilities/src/testss/fixtures/**/*.graphql |
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.
Double s here might be the cause of the linting failures
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.
Thank you. This was driving me nuts.
|
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.
Looking pretty great!
I think I spotted two little things to tweak inline. fixup those two and I think we're good to go!
I see there's till many mentions of **/test/**
in tsconfig files but I guess those are the problematic packages and those entire exclude declarations shall be removed in follow up PRs
@@ -4,6 +4,5 @@ | |||
"outDir": "build/ts", | |||
"rootDir": "src", | |||
"baseUrl": "src" | |||
}, | |||
"include": ["./src/**/*.ts"] |
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 think this needs to stay
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.
Reverted.
Co-authored-by: Ben Scott <227292+BPScott@users.noreply.github.com>
Description
Tests aren't being type checked because they are excluded
tsconfig.json
files. If this exclusion is removed type-checking is applied, but the resultant test build files need to be excluded from the package.This PR
!build/ts/**/*.test.*
file exclusion the to allpackage.json
files.build/*
include pattern was changed tobuild
in order for the exclusion pattern to work properly.tsconfig.json
in cases where there aren't type errors. Most packages have type errors that will be addressed in the future. To check just remove the test patterns from the exclude section oftsconfig.json
.test/
directories totests/
across all packages. This improved consistency removes the need to match multiple patterns for tests.To test what files are included in a package, use
npx npm-packlist
from the package directory.Type of change
in all
Patch: Bug (non-breaking change which fixes an issue)Checklist