Co-located component template files

no issue

Keeps component JS backing files and template files in the same directory which avoids hunting across directories when working with components. Also lets you see all components when looking at one directory, whereas previously template-only or js-only components may not have been obvious without looking at both directories.

- ran [codemod](https://github.com/ember-codemods/ember-component-template-colocation-migrator/) for app-level components
- manually moved in-repo-addon component templates in `lib/koenig-editor`
- removed all explicit `layout` imports as JS/template associations are now made at build-time removing the need for them
- updated `.embercli` to default to new flat component structure
This commit is contained in:
Kevin Ansfield 2020-05-18 13:14:08 +01:00
parent fe96ce7915
commit 09435ecf76
170 changed files with 10 additions and 81 deletions

View File

@ -1,9 +1,11 @@
{
/**
Ember CLI sends analytics information by default. The data is completely
anonymous, but there are times when you might want to disable this behavior.
"component-structure": "flat",
"component-class": "@glimmer/component",
/**
Ember CLI sends analytics information by default. The data is completely
anonymous, but there are times when you might want to disable this behavior.
Setting `disableAnalytics` to true will prevent any data from being sent.
*/
"disableAnalytics": true
Setting `disableAnalytics` to true will prevent any data from being sent.
*/
"disableAnalytics": true
}

View File

@ -1,9 +1,6 @@
import BasicDropdown from 'ember-basic-dropdown/components/basic-dropdown';
import templateLayout from '../templates/components/gh-basic-dropdown';
import {layout} from '@ember-decorators/component';
import {inject as service} from '@ember/service';
@layout(templateLayout)
class GhBasicDropdown extends BasicDropdown {
@service dropdown

View File

@ -1,6 +1,3 @@
import InfinityLoader from 'ember-infinity/components/infinity-loader';
import layout from '../templates/components/gh-infinity-loader';
export default InfinityLoader.extend({
layout
});
export default InfinityLoader.extend();

View File

@ -1,8 +1,5 @@
import PowerSelectTrigger from 'ember-power-select/components/power-select/trigger';
import templateLayout from '../../templates/components/gh-power-select/trigger';
import {layout} from '@ember-decorators/component';
@layout(templateLayout)
export default class Trigger extends PowerSelectTrigger {
}

View File

@ -1,9 +1,8 @@
import $ from 'jquery';
import PowerSelectMultiple from 'ember-power-select/components/power-select-multiple';
import templateLayout from '../../templates/components/gh-token-input/select-multiple';
import {action} from '@ember/object';
import {bind} from '@ember/runloop';
import {layout, tagName} from '@ember-decorators/component';
import {tagName} from '@ember-decorators/component';
// TODO: convert from jQuery to native DOM
const END_ACTIONS = 'click.ghToken mouseup.ghToken touchend.ghToken';
@ -14,7 +13,6 @@ const END_ACTIONS = 'click.ghToken mouseup.ghToken touchend.ghToken';
// we get another event signalling the end of a drag
@tagName('div')
@layout(templateLayout)
class GhTokenInputSelectMultiple extends PowerSelectMultiple {
_canFocus = true;

Some files were not shown because too many files have changed in this diff Show More