ember-cli 4.11.0-beta.0 → 4.11.1-beta.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.
@@ -557,10 +557,7 @@ module.exports = class DefaultPackager {
557
557
  };
558
558
 
559
559
  let stylesAndVendor = callAddonsPreprocessTreeHook(this.project, 'css', tree);
560
- stylesAndVendor = this._debugTree(stylesAndVendor, 'mu-layout:addonsPreprocessTree:css');
561
-
562
560
  let preprocessedStyles = preprocessCss(stylesAndVendor, '/app/styles', '/assets', options);
563
- preprocessedStyles = this._debugTree(preprocessedStyles, 'mu-layout:preprocess:css');
564
561
 
565
562
  let vendorStyles = [];
566
563
  for (let outputFile in this.styleOutputFiles) {
@@ -1,5 +1,6 @@
1
1
  'use strict';
2
2
 
3
+ const SilentError = require('silent-error');
3
4
  const NewCommand = require('./new');
4
5
 
5
6
  module.exports = NewCommand.extend({
@@ -30,4 +31,16 @@ module.exports = NewCommand.extend({
30
31
  ],
31
32
 
32
33
  anonymousOptions: ['<addon-name>'],
34
+
35
+ run(commandOptions, commandArguments) {
36
+ let addonName = commandArguments[0];
37
+
38
+ if (addonName) {
39
+ return this._super(commandOptions, commandArguments);
40
+ }
41
+
42
+ return Promise.reject(
43
+ new SilentError('The `ember addon` command requires a name to be specified. For more details, run `ember help`.')
44
+ );
45
+ },
33
46
  });
@@ -1,6 +1,5 @@
1
1
  'use strict';
2
2
 
3
- const fs = require('fs-extra');
4
3
  const chalk = require('chalk');
5
4
  const Command = require('../models/command');
6
5
  const Project = require('../models/project');
@@ -115,7 +114,7 @@ module.exports = Command.extend({
115
114
  project: Project.nullProject(this.ui, this.cli),
116
115
  });
117
116
 
118
- let opts = await this.runTask('CreateAndStepIntoDirectory', {
117
+ await this.runTask('CreateAndStepIntoDirectory', {
119
118
  projectName,
120
119
  directoryName: commandOptions.directory,
121
120
  dryRun: commandOptions.dryRun,
@@ -123,17 +122,6 @@ module.exports = Command.extend({
123
122
 
124
123
  initCommand.project.root = process.cwd();
125
124
 
126
- try {
127
- let response = await initCommand.run(commandOptions, rawArgs);
128
- return response;
129
- } catch (err) {
130
- let { initialDirectory, projectDirectory } = opts;
131
-
132
- process.chdir(initialDirectory);
133
- await fs.remove(projectDirectory);
134
-
135
- console.log(chalk.red(`Error creating new application. Removing generated directory \`./${projectDirectory}\``));
136
- throw err;
137
- }
125
+ return await initCommand.run(commandOptions, rawArgs);
138
126
  },
139
127
  });
@@ -10,8 +10,6 @@ const fs = require('fs');
10
10
  const temp = require('temp');
11
11
  temp.track();
12
12
 
13
- require('express').static.mime.define({ 'application/wasm': ['wasm'] });
14
-
15
13
  let defaultPort = 7357;
16
14
 
17
15
  module.exports = Command.extend({
@@ -81,6 +79,9 @@ module.exports = Command.extend({
81
79
  init() {
82
80
  this._super.apply(this, arguments);
83
81
 
82
+ // Make sure Testem supports the Wasm MIME type:
83
+ require('express').static.mime.define({ 'application/wasm': ['wasm'] });
84
+
84
85
  this.Builder = this.Builder || Builder;
85
86
  this.Watcher = this.Watcher || Watcher;
86
87
 
@@ -23,7 +23,6 @@ const EOL = require('os').EOL;
23
23
  const bowEpParser = require('bower-endpoint-parser');
24
24
  const logger = require('heimdalljs-logger')('ember-cli:blueprint');
25
25
  const normalizeEntityName = require('ember-cli-normalize-entity-name');
26
- const { removeTypes } = require('remove-types');
27
26
  const isAddon = require('../utilities/is-addon');
28
27
  const { deprecate } = require('../debug');
29
28
 
@@ -532,6 +531,7 @@ let Blueprint = CoreObject.extend({
532
531
  async convertToJS(fileInfo) {
533
532
  let rendered = await fileInfo.render();
534
533
 
534
+ const { removeTypes } = require('remove-types');
535
535
  const transformed = await removeTypes(rendered);
536
536
 
537
537
  fileInfo.rendered = transformed;
@@ -1508,23 +1508,6 @@ let Blueprint = CoreObject.extend({
1508
1508
  Blueprint.lookup = function (name, options) {
1509
1509
  options = options || {};
1510
1510
 
1511
- if (name.includes(path.sep)) {
1512
- let blueprintPath = path.resolve(name);
1513
- let isNameAPath = Boolean(blueprintPath);
1514
-
1515
- if (isNameAPath) {
1516
- if (Blueprint._existsSync(blueprintPath)) {
1517
- return Blueprint.load(blueprintPath, options.blueprintOptions);
1518
- }
1519
-
1520
- if (!options.ignoreMissing) {
1521
- throw new SilentError(`Unknown blueprint: ${name}`);
1522
- }
1523
-
1524
- return;
1525
- }
1526
- }
1527
-
1528
1511
  let lookupPaths = generateLookupPaths(options.paths);
1529
1512
 
1530
1513
  let lookupPath;
@@ -1536,6 +1519,15 @@ Blueprint.lookup = function (name, options) {
1536
1519
  }
1537
1520
  }
1538
1521
 
1522
+ // Check if `name` itself is a path to a blueprint:
1523
+ if (name.includes(path.sep)) {
1524
+ let blueprintPath = path.resolve(name);
1525
+
1526
+ if (Blueprint._existsSync(blueprintPath)) {
1527
+ return Blueprint.load(blueprintPath, options.blueprintOptions);
1528
+ }
1529
+ }
1530
+
1539
1531
  if (!options.ignoreMissing) {
1540
1532
  throw new SilentError(`Unknown blueprint: ${name}`);
1541
1533
  }
@@ -1,9 +1,5 @@
1
1
  'use strict';
2
2
 
3
- const inquirer = require('inquirer');
4
- const { isLangCode } = require('is-language-code');
5
- const osLocale = require('os-locale');
6
-
7
3
  const Task = require('../models/task');
8
4
  const isValidProjectName = require('../utilities/valid-project-name');
9
5
 
@@ -11,6 +7,8 @@ const DEFAULT_LOCALE = 'en-US';
11
7
 
12
8
  class InteractiveNewTask extends Task {
13
9
  async run(newCommandOptions, _testAnswers) {
10
+ const inquirer = require('inquirer');
11
+
14
12
  let prompt = inquirer.createPromptModule();
15
13
  let questions = await this.getQuestions(newCommandOptions);
16
14
  let answers = await prompt(questions, _testAnswers);
@@ -24,6 +22,8 @@ class InteractiveNewTask extends Task {
24
22
  }
25
23
 
26
24
  async getQuestions(newCommandOptions = {}) {
25
+ const { isLangCode } = require('is-language-code');
26
+
27
27
  return [
28
28
  {
29
29
  name: 'blueprint',
@@ -145,6 +145,8 @@ class InteractiveNewTask extends Task {
145
145
  }
146
146
 
147
147
  getUserLocale() {
148
+ const osLocale = require('os-locale');
149
+
148
150
  return osLocale();
149
151
  }
150
152
  }
@@ -25,8 +25,6 @@ class NpmTask extends Task {
25
25
 
26
26
  // The command to run: can be 'install' or 'uninstall'
27
27
  this.command = '';
28
-
29
- this.versionConstraints = '3 || 4 || 5 || 6 || 7 || 8';
30
28
  }
31
29
 
32
30
  get packageManagerOutputName() {
@@ -115,24 +113,6 @@ class NpmTask extends Task {
115
113
  let version = result.stdout;
116
114
  logger.info('npm --version: %s', version);
117
115
 
118
- let ok = semver.satisfies(version, this.versionConstraints);
119
- if (!ok) {
120
- logger.warn('npm --version is outside of version constraint: %s', this.versionConstraints);
121
-
122
- let below = semver.ltr(version, this.versionConstraints);
123
- if (below) {
124
- throw new SilentError(
125
- 'Ember CLI is now using the global npm, but your npm version is outdated.\n' +
126
- 'Please update your global npm version by running: npm install -g npm'
127
- );
128
- }
129
-
130
- this.ui.writeWarnLine(
131
- 'Ember CLI is using the global npm, but your npm version has not yet been ' +
132
- 'verified to work with the current Ember CLI release.'
133
- );
134
- }
135
-
136
116
  return { name: 'npm', version };
137
117
  } catch (error) {
138
118
  logger.error('npm --version failed: %s', error);
@@ -1,7 +1,5 @@
1
1
  'use strict';
2
2
 
3
- const shimAmd = require('./amd-shim');
4
-
5
3
  class AmdTransformAddon {
6
4
  /**
7
5
  * This addon is used to register a custom AMD transform for app and addons to use.
@@ -15,6 +13,8 @@ class AmdTransformAddon {
15
13
  }
16
14
 
17
15
  importTransforms() {
16
+ const shimAmd = require('./amd-shim');
17
+
18
18
  return {
19
19
  amd: {
20
20
  transform: (tree, options) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ember-cli",
3
- "version": "4.11.0-beta.0",
3
+ "version": "4.11.1-beta.0",
4
4
  "description": "Command line tool for developing ambitious ember.js apps",
5
5
  "keywords": [
6
6
  "app",
@@ -37,8 +37,8 @@
37
37
  "test:slow": "node --unhandled-rejections=strict tests/runner slow"
38
38
  },
39
39
  "dependencies": {
40
- "@babel/core": "^7.20.12",
41
- "@babel/plugin-transform-modules-amd": "^7.19.6",
40
+ "@babel/core": "^7.21.0",
41
+ "@babel/plugin-transform-modules-amd": "^7.20.11",
42
42
  "amd-name-resolver": "^1.3.1",
43
43
  "babel-plugin-module-resolver": "^4.1.0",
44
44
  "bower-config": "^1.4.3",
@@ -74,7 +74,6 @@
74
74
  "ember-cli-normalize-entity-name": "^1.0.0",
75
75
  "ember-cli-preprocess-registry": "^3.3.0",
76
76
  "ember-cli-string-utils": "^1.1.0",
77
- "ember-source-channel-url": "^3.0.0",
78
77
  "ensure-posix-path": "^1.1.1",
79
78
  "execa": "^5.1.1",
80
79
  "exit": "^0.1.2",
@@ -83,11 +82,11 @@
83
82
  "find-up": "^5.0.0",
84
83
  "find-yarn-workspace-root": "^2.0.0",
85
84
  "fixturify-project": "^2.1.1",
86
- "fs-extra": "^10.1.0",
85
+ "fs-extra": "^11.1.0",
87
86
  "fs-tree-diff": "^2.0.1",
88
87
  "get-caller-file": "^2.0.5",
89
88
  "git-repo-info": "^2.1.1",
90
- "glob": "^8.0.3",
89
+ "glob": "^8.1.0",
91
90
  "heimdalljs": "^0.2.6",
92
91
  "heimdalljs-fs-monitor": "^1.1.1",
93
92
  "heimdalljs-graph": "^1.0.0",
@@ -103,7 +102,7 @@
103
102
  "lodash.template": "^4.5.0",
104
103
  "markdown-it": "^13.0.1",
105
104
  "markdown-it-terminal": "^0.4.0",
106
- "minimatch": "^5.1.0",
105
+ "minimatch": "^7.4.1",
107
106
  "morgan": "^1.10.0",
108
107
  "nopt": "^3.0.6",
109
108
  "npm-package-arg": "^10.1.0",
@@ -116,7 +115,7 @@
116
115
  "remove-types": "^1.0.0",
117
116
  "resolve": "^1.22.1",
118
117
  "resolve-package-path": "^4.0.3",
119
- "safe-stable-stringify": "^2.3.1",
118
+ "safe-stable-stringify": "^2.4.2",
120
119
  "sane": "^5.0.1",
121
120
  "semver": "^7.3.5",
122
121
  "silent-error": "^1.1.1",
@@ -126,15 +125,14 @@
126
125
  "testem": "^3.10.1",
127
126
  "tiny-lr": "^2.0.0",
128
127
  "tree-sync": "^2.1.0",
129
- "uuid": "^8.3.2",
128
+ "uuid": "^9.0.0",
130
129
  "walk-sync": "^3.0.0",
131
130
  "watch-detector": "^1.0.2",
132
- "workerpool": "^6.3.1",
131
+ "workerpool": "^6.4.0",
133
132
  "yam": "^1.0.0"
134
133
  },
135
134
  "devDependencies": {
136
- "@ember/edition-utils": "^1.2.0",
137
- "@octokit/rest": "^19.0.5",
135
+ "@octokit/rest": "^19.0.7",
138
136
  "broccoli-plugin": "^4.0.3",
139
137
  "broccoli-test-helper": "^2.0.0",
140
138
  "chai": "^4.3.7",
@@ -143,14 +141,14 @@
143
141
  "chai-jest-snapshot": "^2.0.0",
144
142
  "ember-cli-blueprint-test-helpers": "^0.19.2",
145
143
  "ember-cli-internal-test-helpers": "^0.9.1",
146
- "eslint": "^8.28.0",
147
- "eslint-config-prettier": "^8.5.0",
144
+ "eslint": "^8.35.0",
145
+ "eslint-config-prettier": "^8.6.0",
148
146
  "eslint-plugin-chai-expect": "^3.0.0",
149
147
  "eslint-plugin-mocha": "^10.1.0",
150
148
  "eslint-plugin-n": "^15.3.0",
151
149
  "eslint-plugin-prettier": "^4.2.1",
152
- "fixturify": "^2.1.0",
153
- "jsdom": "^20.0.3",
150
+ "fixturify": "^3.0.0",
151
+ "jsdom": "^21.1.0",
154
152
  "latest-version": "^5.1.0",
155
153
  "mocha": "^10.0.0",
156
154
  "nock": "^13.2.9",
@@ -163,7 +161,7 @@
163
161
  "testdouble": "^3.16.6",
164
162
  "tmp": "^0.2.1",
165
163
  "websocket": "^1.0.32",
166
- "which": "2.0.2",
164
+ "which": "3.0.0",
167
165
  "yuidoc-ember-cli-theme": "^1.0.4",
168
166
  "yuidocjs": "0.10.2"
169
167
  },
@@ -186,5 +184,9 @@
186
184
  "tokenRef": "GITHUB_AUTH"
187
185
  }
188
186
  },
189
- "trackingCode": "UA-49225444-1"
187
+ "trackingCode": "UA-49225444-1",
188
+ "volta": {
189
+ "node": "14.21.3",
190
+ "yarn": "1.22.19"
191
+ }
190
192
  }
@@ -1,7 +1,7 @@
1
1
  'use strict';
2
2
 
3
3
  // eslint-disable-next-line n/no-unpublished-require
4
- const expect = require('chai').expect;
4
+ const { expect } = require('chai');
5
5
  const semver = require('semver');
6
6
 
7
7
  module.exports = function assertVersionLock(_deps) {
@@ -1,19 +0,0 @@
1
- 'use strict';
2
-
3
- const Command = require('../models/command');
4
- const SilentError = require('silent-error');
5
-
6
- module.exports = Command.extend({
7
- name: 'uninstall:npm',
8
- description: 'Npm package uninstall are now managed by the user.',
9
- works: 'insideProject',
10
- skipHelp: true,
11
-
12
- anonymousOptions: ['<package-names...>'],
13
-
14
- run() {
15
- let err = 'This command has been removed. Please use `npm uninstall ';
16
- err += '<packageName> --save-dev` instead.';
17
- return Promise.reject(new SilentError(err));
18
- },
19
- });