-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: removed auto component namespaceing
- Loading branch information
Showing
14 changed files
with
62 additions
and
5 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
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 |
---|---|---|
|
@@ -2,4 +2,5 @@ | |
|
||
module.exports = { | ||
singleQuote: true, | ||
|
||
}; |
Empty file.
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
Empty file.
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
28 changes: 28 additions & 0 deletions
28
packages/namespace/tests/acceptance/with-component-file-test.js
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,28 @@ | ||
import { visit } from '@ember/test-helpers'; | ||
import { module, test } from 'qunit'; | ||
import { setupApplicationTest } from 'ember-qunit'; | ||
|
||
import styleForSetup from 'dummy/tests/setup/style-for'; | ||
|
||
module('Acceptance | with component file', function (hooks) { | ||
setupApplicationTest(hooks); | ||
styleForSetup(hooks); | ||
|
||
test('should be able import styleNamespace in a glimmer component', async function (assert) { | ||
await visit('/with-component-file'); | ||
|
||
assert.strictEqual( | ||
this.styleFor(`h3:first-of-type`).color, | ||
'rgb(255, 0, 1)' | ||
); | ||
}); | ||
|
||
test('should be able import styleNamespace in a classic component', async function (assert) { | ||
await visit('/with-component-file'); | ||
|
||
assert.strictEqual( | ||
this.styleFor(`h3:last-of-type`).color, | ||
'rgb(255, 0, 1)' | ||
); | ||
}); | ||
}); |
1 change: 1 addition & 0 deletions
1
packages/namespace/tests/dummy/app/components/with-component-file/classic.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 @@ | ||
<h3> Hello There </h3> |
11 changes: 11 additions & 0 deletions
11
packages/namespace/tests/dummy/app/components/with-component-file/classic.js
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,11 @@ | ||
/* eslint-disable ember/require-tagless-components */ | ||
/* eslint-disable ember/no-classic-classes */ | ||
/* eslint-disable ember/no-classic-components */ | ||
|
||
import Component from '@ember/component'; | ||
import { styleNamespace } from './generic.scss'; | ||
|
||
export default Component.extend({ | ||
styleNamespace: styleNamespace, | ||
classNameBindings: ['styleNamespace'], | ||
}); |
3 changes: 3 additions & 0 deletions
3
packages/namespace/tests/dummy/app/components/with-component-file/generic.scss
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 @@ | ||
h3 { | ||
color: red; | ||
} |
3 changes: 3 additions & 0 deletions
3
packages/namespace/tests/dummy/app/components/with-component-file/glimmer.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="{{style-namespace runClass=this.styleNamespace}}"> | ||
<h3> Hello There </h3> | ||
</div> |
6 changes: 6 additions & 0 deletions
6
packages/namespace/tests/dummy/app/components/with-component-file/glimmer.js
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,6 @@ | ||
import Component from '@glimmer/component'; | ||
import { styleNamespace } from './generic.scss'; | ||
|
||
export default class WithComponentFileGlimmer extends Component { | ||
styleNamespace = styleNamespace; | ||
} |
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
2 changes: 2 additions & 0 deletions
2
packages/namespace/tests/dummy/app/with-component-file/template.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,2 @@ | ||
<WithComponentFile::glimmer></WithComponentFile::glimmer> | ||
<WithComponentFile::classic></WithComponentFile::classic> |