-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
move node_modules into root folder [action required] #1408
Conversation
Recommend removing ts/node_modules folder before attempting to build after this update. This moves ts/node_modules into the root of the project to work around #1405 (comment) Also fixes the sass errors shown when running scripts/svelte-check
I think we're getting closer, but this still does not work for me. With the PR as is, VS Code can now find definitions. E.g. when opening In comparison to that, when removing |
Sorry, we could have avoided some back and forth if I'd asked you to explain the problem you were experiencing in more detail earlier :-) The "go to definition" being broken was mentioned in a3d9f90:
It appears the Svelte plugin for VS Code will preferentially use the .d.ts file over the .svelte file. It's a trade-off: we lose the ability to jump directly to the .svelte file, but the editor now understands non-default exports from the Svelte module as well, so { components } in editor/index.ts displays correctly for example. I imagine what's happening when you remove "." from rootDirs is you break the build :-). If you run it from a terminal, you get this:
That prevents VS Code from reading the generated sources, and presumably prevents it from reading the svelte.d.ts files as well - so it behaves as if there were no svelte.d.ts files, allowing you to jump to their definitions instead. The reason Bazel still works is because it's manually including args like --rootDir as it builds each project. As for the lack of type checking, it appears the .d.ts files we're creating do not have the properties set correctly, eg: import { SvelteComponentTyped } from "svelte";
declare const __propDef: any;
export declare type SpinBoxProps = typeof __propDef.props;
export declare type SpinBoxEvents = typeof __propDef.events;
export declare type SpinBoxSlots = typeof __propDef.slots;
export default class SpinBox extends SvelteComponentTyped<SpinBoxProps, SpinBoxEvents, SpinBoxSlots> {
}
export {}; I believe they were working before, and I suspect if they can be fixed, the editor typechecking will work again - will look into it. |
I erroneously removed them near the end of the ts_project work, and didn't realise the properties had broken.
Does the latest commit resolve your remaining issues? |
Yes! Awesome, look forward to the full typing experience :) |
Recommend removing ts/node_modules folder before attempting to
build after this update.
This moves ts/node_modules into the root of the project to work around
#1405 (comment)
Also fixes the sass errors shown when running scripts/svelte-check