Skip to content

Commit

Permalink
Merge pull request #43 from bertdeblock/remove-nested-ternary-operato…
Browse files Browse the repository at this point in the history
…rs-in-documents

Remove nested ternary operators in generator documents
  • Loading branch information
bertdeblock authored Nov 28, 2024
2 parents 617b2d8 + 56df6e9 commit 3151fb5
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 13 deletions.
8 changes: 4 additions & 4 deletions documents/component.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@ root: "."
output: "**/*"
---

# {{inputs.typescript ? "!" : (inputs.classBased ? "!" : "")}}{{inputs.name.path}}.gjs
# {{!inputs.typescript && !inputs.classBased ? "" : "!"}}{{inputs.name.path}}.gjs

```gjs
<template>{{"{{"}}yield{{"}}"}}</template>
```

# {{inputs.typescript ? "!" : (inputs.classBased ? "" : "!")}}{{inputs.name.path}}.gjs
# {{!inputs.typescript && inputs.classBased ? "" : "!"}}{{inputs.name.path}}.gjs

```gjs
import Component from "@glimmer/component";
Expand All @@ -22,7 +22,7 @@ export default class {{inputs.name.pascal}} extends Component {
```

# {{inputs.typescript ? (inputs.classBased ? "!" : "") : "!"}}{{inputs.name.path}}.gts
# {{inputs.typescript && !inputs.classBased ? "" : "!"}}{{inputs.name.path}}.gts

```gts
import type { TOC } from '@ember/component/template-only';
Expand All @@ -41,7 +41,7 @@ export default {{inputs.name.pascal}};
```

# {{inputs.typescript ? (inputs.classBased ? "" : "!") : "!"}}{{inputs.name.path}}.gts
# {{inputs.typescript && inputs.classBased ? "" : "!"}}{{inputs.name.path}}.gts

```gts
import Component from "@glimmer/component";
Expand Down
6 changes: 5 additions & 1 deletion documents/config.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
export default {
import type { Config } from "scaffdog";

const config: Config = {
files: ["*.md"],
};

export default config;
8 changes: 4 additions & 4 deletions documents/helper.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ root: "."
output: "**/*"
---

# {{inputs.typescript ? "!" : (inputs.classBased ? "!" : "")}}{{inputs.name.path}}.js
# {{!inputs.typescript && !inputs.classBased ? "" : "!"}}{{inputs.name.path}}.js

```js
import { helper } from "@ember/component/helper";
Expand All @@ -15,7 +15,7 @@ export default helper(function {{inputs.name.camel}}(positional, named) {

```

# {{inputs.typescript ? "!" : (inputs.classBased ? "" : "!")}}{{inputs.name.path}}.js
# {{!inputs.typescript && inputs.classBased ? "" : "!"}}{{inputs.name.path}}.js

```js
import Helper from "@ember/component/helper";
Expand All @@ -28,7 +28,7 @@ export default class {{inputs.name.pascal}} extends Helper {

```

# {{inputs.typescript ? (inputs.classBased ? "!" : "") : "!"}}{{inputs.name.path}}.ts
# {{inputs.typescript && !inputs.classBased ? "" : "!"}}{{inputs.name.path}}.ts

```ts
import { helper } from "@ember/component/helper";
Expand All @@ -51,7 +51,7 @@ export default helper<{{inputs.signature}}>(function {{inputs.name.camel}}(posit

```

# {{inputs.typescript ? (inputs.classBased ? "" : "!") : "!"}}{{inputs.name.path}}.ts
# {{inputs.typescript && inputs.classBased ? "" : "!"}}{{inputs.name.path}}.ts

```ts
import Helper from "@ember/component/helper";
Expand Down
8 changes: 4 additions & 4 deletions documents/modifier.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ root: "."
output: "**/*"
---

# {{inputs.typescript ? "!" : (inputs.classBased ? "!" : "")}}{{inputs.name.path}}.js
# {{!inputs.typescript && !inputs.classBased ? "" : "!"}}{{inputs.name.path}}.js

```js
import { modifier } from "ember-modifier";
Expand All @@ -13,7 +13,7 @@ export default modifier(function {{inputs.name.camel}}(element, positional, name

```

# {{inputs.typescript ? "!" : (inputs.classBased ? "" : "!")}}{{inputs.name.path}}.js
# {{!inputs.typescript && inputs.classBased ? "" : "!"}}{{inputs.name.path}}.js

```js
import Modifier from "ember-modifier";
Expand All @@ -24,7 +24,7 @@ export default class {{inputs.name.pascal}} extends Modifier {

```

# {{inputs.typescript ? (inputs.classBased ? "!" : "") : "!"}}{{inputs.name.path}}.ts
# {{inputs.typescript && !inputs.classBased ? "" : "!"}}{{inputs.name.path}}.ts

```ts
import { modifier } from "ember-modifier";
Expand All @@ -41,7 +41,7 @@ export default modifier<{{inputs.signature}}>(function {{inputs.name.camel}}(ele

```

# {{inputs.typescript ? (inputs.classBased ? "" : "!") : "!"}}{{inputs.name.path}}.ts
# {{inputs.typescript && inputs.classBased ? "" : "!"}}{{inputs.name.path}}.ts

```ts
import Modifier from "ember-modifier";
Expand Down
3 changes: 3 additions & 0 deletions vitest.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,7 @@ export default defineConfig({
ignored: ["**/test/output/**"],
},
},
test: {
forceRerunTriggers: ["**/documents/**"],
},
});

0 comments on commit 3151fb5

Please sign in to comment.