Skip to content

Commit

Permalink
Fix modifier and service names
Browse files Browse the repository at this point in the history
  • Loading branch information
bertdeblock committed Mar 13, 2024
1 parent 4434ccb commit 47481bc
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 9 deletions.
4 changes: 3 additions & 1 deletion .scaffdog/documents/modifier.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,10 @@ output: "**/*"
# [[inputs.name]].[[inputs.authoringFormat]]

```ts
[[name := camel(inputs.name)-]]

import { modifier } from "ember-modifier";

export default modifier(function foo(element /*, positional, named*/) {});
export default modifier(function [[name]](element /*, positional, named*/) {});

```
4 changes: 2 additions & 2 deletions .scaffdog/documents/service.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@ output: "**/*"

import Service from "@ember/service";

export default class [[name]]Service extends Service {}
export default class [[name]] extends Service {}
[[if inputs.authoringFormat == "ts"]]
declare module "@ember/service" {
interface Registry {
"[[inputs.name]]": [[name]]Service;
"[[inputs.name]]": [[name]];
}
}
[[end]]
Expand Down
12 changes: 6 additions & 6 deletions test/__snapshots__/generate-service.test.ts.snap
Original file line number Diff line number Diff line change
Expand Up @@ -3,25 +3,25 @@
exports[`generates a \`.js\` service 1`] = `
"import Service from "@ember/service";
export default class FooService extends Service {}
export default class Foo extends Service {}
"
`;

exports[`generates a \`.js\` service at a custom path 1`] = `
"import Service from "@ember/service";
export default class FooService extends Service {}
export default class Foo extends Service {}
"
`;

exports[`generates a \`.ts\` service 1`] = `
"import Service from "@ember/service";
export default class FooService extends Service {}
export default class Foo extends Service {}
declare module "@ember/service" {
interface Registry {
"foo": FooService;
"foo": Foo;
}
}
"
Expand All @@ -30,11 +30,11 @@ declare module "@ember/service" {
exports[`generates a \`.ts\` service at a custom path 1`] = `
"import Service from "@ember/service";
export default class FooService extends Service {}
export default class Foo extends Service {}
declare module "@ember/service" {
interface Registry {
"foo": FooService;
"foo": Foo;
}
}
"
Expand Down

0 comments on commit 47481bc

Please sign in to comment.