ember-source 6.0.0-alpha.9 → 6.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,13 +1,10 @@
1
1
  'use strict';
2
2
 
3
3
  const chalk = require('chalk');
4
- const path = require('path');
5
4
  const SilentError = require('silent-error');
6
5
  const stringUtil = require('ember-cli-string-utils');
7
- const pathUtil = require('ember-cli-path-utils');
8
6
  const getPathOption = require('ember-cli-get-component-path-option');
9
7
  const normalizeEntityName = require('ember-cli-normalize-entity-name');
10
- const { EOL } = require('os');
11
8
  const { has } = require('@ember/edition-utils');
12
9
  const { generateComponentSignature } = require('../-utils');
13
10
 
@@ -48,9 +45,9 @@ module.exports = {
48
45
  },
49
46
  {
50
47
  name: 'component-structure',
51
- type: OCTANE ? ['flat', 'nested', 'classic'] : ['classic'],
52
- default: OCTANE ? 'flat' : 'classic',
53
- aliases: OCTANE ? [{ fs: 'flat' }, { ns: 'nested' }, { cs: 'classic' }] : [{ cs: 'classic' }],
48
+ type: ['flat', 'nested'],
49
+ default: 'flat',
50
+ aliases: [{ fs: 'flat' }, { ns: 'nested' }],
54
51
  },
55
52
  ],
56
53
 
@@ -75,15 +72,9 @@ module.exports = {
75
72
  option.default = '@ember/component';
76
73
  }
77
74
  } else if (option.name === 'component-structure') {
78
- if (isOctane) {
79
- option.type = ['flat', 'nested', 'classic'];
80
- option.default = 'flat';
81
- option.aliases = [{ fs: 'flat' }, { ns: 'nested' }, { cs: 'classic' }];
82
- } else {
83
- option.type = ['classic'];
84
- option.default = 'classic';
85
- option.aliases = [{ cs: 'classic' }];
86
- }
75
+ option.type = ['flat', 'nested'];
76
+ option.default = 'flat';
77
+ option.aliases = [{ fs: 'flat' }, { ns: 'nested' }];
87
78
  }
88
79
  });
89
80
 
@@ -107,12 +98,6 @@ module.exports = {
107
98
  'Usage of --component-class argument to `ember generate component` is only available on canary'
108
99
  );
109
100
  }
110
-
111
- if (options.componentStructure !== 'classic') {
112
- throw new SilentError(
113
- 'Usage of --component-structure argument to `ember generate component` is only available on canary'
114
- );
115
- }
116
101
  }
117
102
 
118
103
  return this._super.install.apply(this, arguments);
@@ -149,37 +134,7 @@ module.exports = {
149
134
  fileMapTokens(options) {
150
135
  let commandOptions = this.options;
151
136
 
152
- if (commandOptions.pod) {
153
- return {
154
- __path__() {
155
- return path.join(options.podPath, options.locals.path, options.dasherizedModuleName);
156
- },
157
- __templatepath__() {
158
- return path.join(options.podPath, options.locals.path, options.dasherizedModuleName);
159
- },
160
- __templatename__() {
161
- return 'template';
162
- },
163
- };
164
- } else if (
165
- !this.EMBER_GLIMMER_SET_COMPONENT_TEMPLATE ||
166
- commandOptions.componentStructure === 'classic'
167
- ) {
168
- return {
169
- __path__() {
170
- return 'components';
171
- },
172
- __templatepath__() {
173
- return 'templates/components';
174
- },
175
- __templatename__() {
176
- return options.dasherizedModuleName;
177
- },
178
- };
179
- } else if (
180
- this.EMBER_GLIMMER_SET_COMPONENT_TEMPLATE &&
181
- commandOptions.componentStructure === 'flat'
182
- ) {
137
+ if (this.EMBER_GLIMMER_SET_COMPONENT_TEMPLATE && commandOptions.componentStructure === 'flat') {
183
138
  return {
184
139
  __path__() {
185
140
  return 'components';
@@ -236,19 +191,6 @@ module.exports = {
236
191
  },
237
192
 
238
193
  locals(options) {
239
- // if we're in an addon, build import statement
240
- let templatePath = '';
241
- if (options.project.isEmberCLIAddon() || (options.inRepoAddon && !options.inDummy)) {
242
- if (options.pod) {
243
- templatePath = './template';
244
- } else {
245
- templatePath =
246
- pathUtil.getRelativeParentPath(options.entity.name) +
247
- 'templates/components/' +
248
- stringUtil.dasherize(options.entity.name);
249
- }
250
- }
251
-
252
194
  let componentClass = this.EMBER_GLIMMER_SET_COMPONENT_TEMPLATE
253
195
  ? options.componentClass
254
196
  : '@ember/component';
@@ -264,12 +206,7 @@ module.exports = {
264
206
  switch (componentClass) {
265
207
  case '@ember/component':
266
208
  importComponent = `import Component from '@ember/component';`;
267
- if (templatePath) {
268
- importTemplate = `import layout from '${templatePath}';${EOL}`;
269
- defaultExport = `Component.extend({${EOL} layout${EOL}});`;
270
- } else {
271
- defaultExport = `Component.extend({});`;
272
- }
209
+ defaultExport = `Component.extend({});`;
273
210
  break;
274
211
  case '@glimmer/component':
275
212
  importComponent = `import Component from '@glimmer/component';`;
@@ -1,12 +1,9 @@
1
1
  'use strict';
2
2
 
3
- const path = require('path');
4
3
  const SilentError = require('silent-error');
5
4
  const stringUtil = require('ember-cli-string-utils');
6
- const pathUtil = require('ember-cli-path-utils');
7
5
  const getPathOption = require('ember-cli-get-component-path-option');
8
6
  const normalizeEntityName = require('ember-cli-normalize-entity-name');
9
- const { EOL } = require('os');
10
7
  const { has } = require('@ember/edition-utils');
11
8
  const { generateComponentSignature } = require('../-utils');
12
9
 
@@ -44,9 +41,9 @@ module.exports = {
44
41
  },
45
42
  {
46
43
  name: 'component-structure',
47
- type: OCTANE ? ['flat', 'nested', 'classic'] : ['classic'],
48
- default: OCTANE ? 'flat' : 'classic',
49
- aliases: OCTANE ? [{ fs: 'flat' }, { ns: 'nested' }, { cs: 'classic' }] : [{ cs: 'classic' }],
44
+ type: ['flat', 'nested'],
45
+ default: 'flat',
46
+ aliases: [{ fs: 'flat' }, { ns: 'nested' }],
50
47
  },
51
48
  ],
52
49
 
@@ -71,15 +68,9 @@ module.exports = {
71
68
  option.default = '@ember/component';
72
69
  }
73
70
  } else if (option.name === 'component-structure') {
74
- if (isOctane) {
75
- option.type = ['flat', 'nested', 'classic'];
76
- option.default = 'flat';
77
- option.aliases = [{ fs: 'flat' }, { ns: 'nested' }, { cs: 'classic' }];
78
- } else {
79
- option.type = ['classic'];
80
- option.default = 'classic';
81
- option.aliases = [{ cs: 'classic' }];
82
- }
71
+ option.type = ['flat', 'nested'];
72
+ option.default = 'flat';
73
+ option.aliases = [{ fs: 'flat' }, { ns: 'nested' }];
83
74
  }
84
75
  });
85
76
 
@@ -99,19 +90,7 @@ module.exports = {
99
90
  fileMapTokens(options) {
100
91
  let commandOptions = this.options;
101
92
 
102
- if (commandOptions.pod) {
103
- return {
104
- __path__() {
105
- return path.join(options.podPath, options.locals.path, options.dasherizedModuleName);
106
- },
107
- __name__() {
108
- return 'component';
109
- },
110
- };
111
- } else if (
112
- commandOptions.componentStructure === 'classic' ||
113
- commandOptions.componentStructure === 'flat'
114
- ) {
93
+ if (commandOptions.componentStructure === 'flat') {
115
94
  return {
116
95
  __path__() {
117
96
  return 'components';
@@ -139,35 +118,17 @@ module.exports = {
139
118
  let sanitizedModuleName = options.entity.name.replace(/\//g, '-');
140
119
  let classifiedModuleName = stringUtil.classify(sanitizedModuleName);
141
120
 
142
- let templatePath = '';
143
121
  let importComponent = '';
144
122
  let importTemplate = '';
145
123
  let defaultExport = '';
146
124
  let componentSignature = '';
147
125
 
148
- // if we're in an addon, build import statement
149
- if (options.project.isEmberCLIAddon() || (options.inRepoAddon && !options.inDummy)) {
150
- if (options.pod) {
151
- templatePath = './template';
152
- } else {
153
- templatePath =
154
- pathUtil.getRelativeParentPath(options.entity.name) +
155
- 'templates/components/' +
156
- stringUtil.dasherize(options.entity.name);
157
- }
158
- }
159
-
160
126
  let componentClass = options.componentClass;
161
127
 
162
128
  switch (componentClass) {
163
129
  case '@ember/component':
164
130
  importComponent = `import Component from '@ember/component';`;
165
- if (templatePath) {
166
- importTemplate = `import layout from '${templatePath}';${EOL}`;
167
- defaultExport = `Component.extend({${EOL} layout${EOL}});`;
168
- } else {
169
- defaultExport = `Component.extend({});`;
170
- }
131
+ defaultExport = `Component.extend({});`;
171
132
  break;
172
133
  case '@glimmer/component':
173
134
  importComponent = `import Component from '@glimmer/component';`;
@@ -1,6 +1,6 @@
1
1
  {
2
- "version": "6.0.0-alpha.9",
2
+ "version": "6.0.0",
3
3
  "buildType": "tag",
4
- "SHA": "98f7c251c08bf7380b7922ca62d18723275a9bef",
5
- "assetPath": "/tag/shas/98f7c251c08bf7380b7922ca62d18723275a9bef.tgz"
4
+ "SHA": "3b57b6ab7a93d2444c396dd64603c0a12e88a719",
5
+ "assetPath": "/tag/shas/3b57b6ab7a93d2444c396dd64603c0a12e88a719.tgz"
6
6
  }