Skip to content
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

Fix modifier and service names #19

Merged
merged 1 commit into from
Mar 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading