-
Notifications
You must be signed in to change notification settings - Fork 53
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
Resolve config from extends package #781
base: v1.x
Are you sure you want to change the base?
Resolve config from extends package #781
Conversation
import SilentError from 'silent-error'; | ||
import { GlintConfig } from './config.js'; | ||
import { GlintConfigInput } from '@glint/core/config-types'; | ||
import type * as TS from 'typescript'; | ||
|
||
const require = createRequire(import.meta.url); | ||
export const require = createRequire(import.meta.url); |
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.
why export this?
conventionally, we really only want to use createRequire in the file it's used in, since the resolution rules are specific to the import.meta.url
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.
ah, it's for mocking in tests.
can you add a block-comment with something like:
/**
* @private
*
* Only exported for testing purposes. Do not import.
*/
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.
Done
JSON.stringify({ | ||
extends: '@package1/tsconfig.json', | ||
glint: { | ||
environment: '../local-env', |
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.
what's local-env?
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.
To be honest, I simply followed the example from the previous test which uses a predefined environment in the beforeEach
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.
This is looking good -- left some questions.
Also, would you be willing to PR this to the main branch as well?
Definitely, I will create a PR against the main branch |
PR Created |
Resolve glint configuration when your tsconfig.json extends from a package, ex
path: tsconfig.json
path: node_modules/@package1/tsconfig.json
Note: I'm uncertain if this is the correct branch to merge with. If it isn't, please let me know.