-
Notifications
You must be signed in to change notification settings - Fork 12
fix: consider lwc dirs nested under package directories #206
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
Conversation
src/lwc-dev-server/index.ts
Outdated
if (!existsSync(sfdxConfig) || !lstatSync(sfdxConfig).isFile()) { | ||
throw new Error(`sfdx-project.json not found in ${rootDir}`); | ||
if (!packageDirectories || !Array.isArray(packageDirectories)) { | ||
throw new Error('No package directories defined.'); |
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.
Give the user a clue about where to define it and a property name or similar. They can search the docs and figure it out. The error message as-is is not actionable.
throw new Error('No package directories defined.'); | |
throw new Error(`No package directories defined in ${projectJson}.`); |
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.
Changed it to use the API provided by sfdx. It outputs a clean error like this:
Error (MissingDefaultPathError): In sfdx-project.json, be sure to specify which package directory (path) is the default. Example: `[{ "path": "packageDirectory1", "default": true }, { "path": "packageDirectory2" }]`
const s = await lwcDevServer.startLWCServer(logger, path.resolve(__dirname, './__mocks__'), fakeIdentityToken, ''); | ||
expect(s).to.equal(server); | ||
}); | ||
// it('calling startLWCServer returns an LWCServer', async () => { |
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.
Can't figure out a way to mock dirs for tests :(
e6831b8
to
b382d6b
Compare
What does this PR do?
We consider lwc folders under each package directory in this format:
<package-directory>/**/lwc
.What issues does this PR fix or reference?
@W-16844177@
Fixes #185, #174, #212