-
-
Notifications
You must be signed in to change notification settings - Fork 2
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
Handle nested controllers #6
Comments
Thanks! Did I get linked somewhere? 😅
Hm, there is logic to recurse into subdirectories: esbuild-plugin-stimulus/src/index.ts Lines 53 to 60 in f8e57f9
Can you provide a Minimal, Reproducible Example of what you did and what isn't working for you? |
Not directly but with rails 7 embracing esbuild this plugin is gonna get some attention I'm sure :) So realised the issue is that if there are 2 levels of recursion, the identifier ignores the first level of recursion. Here is the repro : https://github.com/Intrepidd/esbuild-stimulus-issue I have var definitions = [
{ identifier: "directory1--bar", controllerConstructor: bar_controller_default },
{ identifier: "directory2--baz", controllerConstructor: baz_controller_default },
{ identifier: "foo", controllerConstructor: foo_controller_default }
]; I have I guess a naive fix would look like : result.push(...await walk(
path.join(dir, ent.name),
- ent.name + '--',
+ (prefix ? prefix + '--' : '') + ent.name + '--',
moduleDir + '/' + ent.name,
)); So that the prefix is not reset for each recursive call Thanks ! |
Also
|
Welcome to the hype :)
This plug-in doesn't recursively look through controller folders.
If you do several imports it works but the definitions are not prefixed with the namespace as expected
How about adding resursive lookup of controllers?
The text was updated successfully, but these errors were encountered: