Skip to content

Commit cef5100

Browse files
Merge pull request #16 from ember-cli/NullVoxPopuli-patch-1
Update glob patterns in README for services and routes
2 parents 44c15b8 + 6babea7 commit cef5100

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

README.md

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,9 @@ In your app.js or app.ts, or wherever you configure your application
3131
+ './services/manual-shorthand': SomeOtherService,
3232
+
3333
+ // now import.meta.glob just works
34-
+ ...import.meta.glob('./services/**/*', { eager: true }),
35-
+ ...import.meta.glob('./routes/*', { eager: true }),
36-
+ ...import.meta.glob('./templates/**/*', { eager: true }),
34+
+ ...import.meta.glob('./services/**/*.{js,ts}', { eager: true }),
35+
+ ...import.meta.glob('./routes/*.{js,ts}', { eager: true }),
36+
+ ...import.meta.glob('./templates/**/*.{gjs,gts}', { eager: true }),
3737
+ };
3838
}
3939
```
@@ -49,6 +49,9 @@ The type of `modules` is:
4949

5050
### `buildRegistry`
5151

52+
> [!IMPORTANT]
53+
> This API is a stop-gap, and will be removed when `@embroider/virtual/compat-modules` supports working in both libraries and apps with no `modulePrefix`
54+
5255
Libraries may declare `ember-strict-application-resolver` as a `dependencies` entry, and then import from `./build-registry` - to provide helpers for packages all the library's services and other things that need to be in the registry (such as from the library's dependencies as well)
5356

5457
For example:
@@ -58,7 +61,7 @@ import { buildRegistry } from 'ember-strict-application-resolver/build-registry'
5861
import TheService from 'from-dependency/services/the-service';
5962

6063
export default buildRegistry({
61-
...import.meta.glob('./services/*', { eager: true }),
64+
...import.meta.glob('./services/*.{js,ts}', { eager: true }),
6265
'./services/the-service': { default: TheService },
6366
});
6467
```
@@ -82,7 +85,7 @@ import { buildRegistry } from 'ember-strict-application-resolver/build-registry'
8285
import libraryRegistry from 'your-library/registry';
8386

8487
export default buildRegistry({
85-
...import.meta.glob('./services/*', { eager: true }),
88+
...import.meta.glob('./services/*.{js,ts}', { eager: true }),
8689
// No argument should be passed here
8790
...libraryRegistry(),
8891
});

0 commit comments

Comments
 (0)