-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Implemented generate commands (Part 1) (#6)
* feature: Provided addon name and test-app location * chore: Updated test setups * feature: Added blueprints for generate commands * feature: Implemented generate commands * chore: Updated fixtures * chore: Added changeset --------- Co-authored-by: ijlee2 <ijlee2@users.noreply.github.com>
- Loading branch information
Showing
150 changed files
with
1,296 additions
and
499 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
"blueprints-addon": minor | ||
--- | ||
|
||
Implemented generate commands (Part 1) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
16 changes: 16 additions & 0 deletions
16
...ueprints-addon/src/blueprints/run-generate/component/__testAppLocation__/__fileName__.gts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
import { <%= data.entity.classifiedName %> } from '<%! options.package.name %>'; | ||
import { render } from '@ember/test-helpers'; | ||
import { module, test } from 'qunit'; | ||
import { setupRenderingTest } from 'test-app/tests/helpers'; | ||
|
||
module('Integration | Component | <%= data.entity.name %>', function (hooks) { | ||
setupRenderingTest(hooks); | ||
|
||
test('it renders', async function (assert) { | ||
await render(<template> | ||
<<%= data.entity.classifiedName %> /> | ||
</template>); | ||
|
||
assert.dom().hasText(''); | ||
}); | ||
}); |
16 changes: 16 additions & 0 deletions
16
...lueprints-addon/src/blueprints/run-generate/component/__testAppLocation__/__fileName__.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
import { render } from '@ember/test-helpers'; | ||
import { hbs } from 'ember-cli-htmlbars'; | ||
import { module, test } from 'qunit'; | ||
import { setupRenderingTest } from 'test-app/tests/helpers'; | ||
|
||
module('Integration | Component | <%= data.entity.name %>', function (hooks) { | ||
setupRenderingTest(hooks); | ||
|
||
test('it renders', async function (assert) { | ||
await render(hbs` | ||
<<%= data.entity.doubleColonizedName %> /> | ||
`); | ||
|
||
assert.dom().hasText(''); | ||
}); | ||
}); |
3 changes: 3 additions & 0 deletions
3
packages/blueprints-addon/src/blueprints/run-generate/component/glimmer/__fileName__.css
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
.container { | ||
/* Style here */ | ||
} |
5 changes: 5 additions & 0 deletions
5
...ages/blueprints-addon/src/blueprints/run-generate/component/glimmer/__fileName__.css.d.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
declare const styles: { | ||
readonly 'container': string; | ||
}; | ||
|
||
export default styles; |
3 changes: 3 additions & 0 deletions
3
packages/blueprints-addon/src/blueprints/run-generate/component/glimmer/__fileName__.hbs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
<div class={{this.styles.container}}> | ||
{{yield}} | ||
</div> |
15 changes: 15 additions & 0 deletions
15
packages/blueprints-addon/src/blueprints/run-generate/component/glimmer/__fileName__.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import Component from '@glimmer/component'; | ||
|
||
import styles from './<%= data.localFileName %>.css'; | ||
|
||
interface <%= data.entity.classifiedName %>Signature { | ||
Args: {}; | ||
Blocks: { | ||
default: []; | ||
}; | ||
Element: null; | ||
} | ||
|
||
export default class <%= data.entity.classifiedName %>Component extends Component<<%= data.entity.classifiedName %>Signature> { | ||
styles = styles; | ||
} |
1 change: 1 addition & 0 deletions
1
...ages/blueprints-addon/src/blueprints/run-generate/component/template-tag/__fileName__.css
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
.container {} |
5 changes: 5 additions & 0 deletions
5
...blueprints-addon/src/blueprints/run-generate/component/template-tag/__fileName__.css.d.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
declare const styles: { | ||
readonly 'container': string; | ||
}; | ||
|
||
export default styles; |
19 changes: 19 additions & 0 deletions
19
...ages/blueprints-addon/src/blueprints/run-generate/component/template-tag/__fileName__.gts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
import Component from '@glimmer/component'; | ||
|
||
import styles from './<%= data.localFileName %>.css'; | ||
|
||
interface <%= data.entity.classifiedName %>Signature { | ||
Args: {}; | ||
Blocks: { | ||
default: []; | ||
}; | ||
Element: null; | ||
} | ||
|
||
export default class <%= data.entity.classifiedName %>Component extends Component<<%= data.entity.classifiedName %>Signature> { | ||
<template> | ||
<div class={{styles.container}}> | ||
{{yield}} | ||
</div> | ||
</template> | ||
} |
18 changes: 18 additions & 0 deletions
18
.../blueprints-addon/src/blueprints/run-generate/helper/__testAppLocation__/__fileName__.gts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
import { <%= data.entity.camelizedName %> } from '<%! options.package.name %>'; | ||
import { render } from '@ember/test-helpers'; | ||
import { module, test } from 'qunit'; | ||
import { setupRenderingTest } from 'test-app/tests/helpers'; | ||
|
||
module('Integration | Helper | <%= data.entity.name %>', function (hooks) { | ||
setupRenderingTest(hooks); | ||
|
||
test('it renders', async function (assert) { | ||
this.inputValue = '1234'; | ||
|
||
await render(<template>> | ||
{{<%= data.entity.camelizedName %> this.inputValue}} | ||
</template>); | ||
|
||
assert.dom().hasText('1234'); | ||
}); | ||
}); |
18 changes: 18 additions & 0 deletions
18
...s/blueprints-addon/src/blueprints/run-generate/helper/__testAppLocation__/__fileName__.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
import { render } from '@ember/test-helpers'; | ||
import { hbs } from 'ember-cli-htmlbars'; | ||
import { module, test } from 'qunit'; | ||
import { setupRenderingTest } from 'test-app/tests/helpers'; | ||
|
||
module('Integration | Helper | <%= data.entity.name %>', function (hooks) { | ||
setupRenderingTest(hooks); | ||
|
||
test('it renders', async function (assert) { | ||
this.inputValue = '1234'; | ||
|
||
await render(hbs` | ||
{{<%= data.entity.name %> this.inputValue}} | ||
`); | ||
|
||
assert.dom().hasText('1234'); | ||
}); | ||
}); |
19 changes: 19 additions & 0 deletions
19
packages/blueprints-addon/src/blueprints/run-generate/helper/class/__fileName__.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
import Helper from '@ember/component/helper'; | ||
|
||
type Named = {}; | ||
type Positional = []; | ||
type Return = Positional; | ||
|
||
interface <%= data.entity.classifiedName %>Signature { | ||
Args: { | ||
Named: Named; | ||
Positional: Positional; | ||
}; | ||
Return: Return; | ||
} | ||
|
||
export default class <%= data.entity.classifiedName %>Helper extends Helper<<%= data.entity.classifiedName %>Signature> { | ||
compute(positional: Positional /*, named: Named*/): Return { | ||
return positional; | ||
} | ||
} |
19 changes: 19 additions & 0 deletions
19
packages/blueprints-addon/src/blueprints/run-generate/helper/function/__fileName__.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
import { helper } from '@ember/component/helper'; | ||
|
||
type Named = {}; | ||
type Positional = []; | ||
type Return = Positional; | ||
|
||
interface <%= data.entity.classifiedName %>Signature { | ||
Args: { | ||
Named: Named; | ||
Positional: Positional; | ||
}; | ||
Return: Return; | ||
} | ||
|
||
export default helper<<%= data.entity.classifiedName %>Signature>( | ||
(positional /*, named*/) => { | ||
return positional; | ||
}, | ||
); |
Oops, something went wrong.