Repository: ember-cli/ember-cli
Pull request #10337 (2023-08-11 18:48:40)

remove EMBER_CLI_PNPM
Removes the feature flag, promotes feature to "stable"


Patch:
diff --git a/lib/commands/init.js b/lib/commands/init.js
index f5bdd0709..524fdabc6 100644
--- a/lib/commands/init.js
+++ b/lib/commands/init.js
@@ -9,7 +9,6 @@ const normalizeBlueprint = require('../utilities/normalize-blueprint-option');
 const mergeBlueprintOptions = require('../utilities/merge-blueprint-options');
 const isYarnProject = require('../utilities/is-yarn-project');
 const getLangArg = require('../../lib/utilities/get-lang-arg');
-const { isExperimentEnabled } = require('../experiments');
 const { getPackageManagerFromFlags } = require('../utilities/get-package-manager-from-flags');
 
 module.exports = Command.extend({
@@ -101,10 +100,6 @@ module.exports = Command.extend({
 
     await this.runTask('InstallBlueprint', blueprintOpts);
 
-    if (commandOptions.pnpm && !isExperimentEnabled('PNPM')) {
-      throw new Error(`--pnpm support is not enabled by default. Please prefix your command with EMBER_CLI_PNPM=true`);
-    }
-
     let packageManager = getPackageManagerFromFlags(commandOptions);
 
     if (!commandOptions.skipNpm) {
diff --git a/lib/commands/new.js b/lib/commands/new.js
index 2cc7929a1..fe88b479c 100644
--- a/lib/commands/new.js
+++ b/lib/commands/new.js
@@ -7,7 +7,6 @@ const SilentError = require('silent-error');
 const isValidProjectName = require('../utilities/valid-project-name');
 const normalizeBlueprint = require('../utilities/normalize-blueprint-option');
 const mergeBlueprintOptions = require('../utilities/merge-blueprint-options');
-const { isExperimentEnabled } = require('../experiments');
 
 module.exports = Command.extend({
   name: 'new',
@@ -92,10 +91,6 @@ module.exports = Command.extend({
       commandOptions.skipGit = true;
     }
 
-    if (commandOptions.pnpm && !isExperimentEnabled('PNPM')) {
-      throw new Error(`--pnpm support is not enabled by default. Please prefix your command with EMBER_CLI_PNPM=true`);
-    }
-
     if (projectName === '.') {
       let blueprintName = commandOptions.blueprint === 'app' ? 'application' : commandOptions.blueprint;
       message = `Trying to generate an ${blueprintName} structure in this directory? Use \`ember init\` instead.`;
diff --git a/lib/experiments/index.js b/lib/experiments/index.js
index c65002e21..948b20958 100644
--- a/lib/experiments/index.js
+++ b/lib/experiments/index.js
@@ -1,7 +1,7 @@
 'use strict';
 
 const chalk = require('chalk');
-const availableExperiments = Object.freeze(['EMBROIDER', 'CLASSIC', 'PNPM']);
+const availableExperiments = Object.freeze(['EMBROIDER', 'CLASSIC']);
 
 const deprecatedExperiments = Object.freeze([]);
 const enabledExperiments = Object.freeze([]);


Test patch:
diff --git a/tests/acceptance/new-test.js b/tests/acceptance/new-test.js
index 3bcf0b971..f2aa6880e 100644
--- a/tests/acceptance/new-test.js
+++ b/tests/acceptance/new-test.js
@@ -557,26 +557,24 @@ describe('Acceptance: ember new', function () {
       checkFileWithEmberCLIVersionReplacement(fixturePath, 'package.json');
     });
 
-    if (isExperimentEnabled('PNPM')) {
-      it('app + pnpm + welcome', async function () {
-        await ember(['new', 'foo', '--skip-npm', '--skip-git', '--pnpm']);
+    it('app + pnpm + welcome', async function () {
+      await ember(['new', 'foo', '--skip-npm', '--skip-git', '--pnpm']);
 
-        let fixturePath = 'app/pnpm';
+      let fixturePath = 'app/pnpm';
 
-        ['app/templates/application.hbs', '.github/workflows/ci.yml', 'README.md'].forEach((filePath) => {
-          checkFile(filePath, path.join(__dirname, '../fixtures', fixturePath, filePath));
-        });
+      ['app/templates/application.hbs', '.github/workflows/ci.yml', 'README.md'].forEach((filePath) => {
+        checkFile(filePath, path.join(__dirname, '../fixtures', fixturePath, filePath));
+      });
 
-        expect(file('.travis.yml')).to.not.exist;
+      expect(file('.travis.yml')).to.not.exist;
 
-        if (isExperimentEnabled('EMBROIDER')) {
-          fixturePath = 'app/embroider-pnpm';
-        }
+      if (isExperimentEnabled('EMBROIDER')) {
+        fixturePath = 'app/embroider-pnpm';
+      }
 
-        checkFileWithEmberCLIVersionReplacement(fixturePath, 'config/ember-cli-update.json');
-        checkFileWithEmberCLIVersionReplacement(fixturePath, 'package.json');
-      });
-    }
+      checkFileWithEmberCLIVersionReplacement(fixturePath, 'config/ember-cli-update.json');
+      checkFileWithEmberCLIVersionReplacement(fixturePath, 'package.json');
+    });
 
     it('addon + yarn + welcome', async function () {
       await ember(['addon', 'foo', '--skip-npm', '--skip-git', '--yarn', '--welcome']);
@@ -599,29 +597,27 @@ describe('Acceptance: ember new', function () {
       checkFileWithEmberCLIVersionReplacement(fixturePath, 'tests/dummy/config/ember-cli-update.json');
     });
 
-    if (isExperimentEnabled('PNPM')) {
-      it('addon + pnpm + welcome', async function () {
-        await ember(['addon', 'foo', '--skip-npm', '--skip-git', '--pnpm', '--welcome']);
+    it('addon + pnpm + welcome', async function () {
+      await ember(['addon', 'foo', '--skip-npm', '--skip-git', '--pnpm', '--welcome']);
 
-        let fixturePath = 'addon/pnpm';
+      let fixturePath = 'addon/pnpm';
 
-        [
-          'tests/dummy/config/ember-try.js',
-          'tests/dummy/app/templates/application.hbs',
-          '.github/workflows/ci.yml',
-          'README.md',
-          'CONTRIBUTING.md',
-          '.npmrc',
-        ].forEach((filePath) => {
-          checkFile(filePath, path.join(__dirname, '../fixtures', fixturePath, filePath));
-        });
+      [
+        'tests/dummy/config/ember-try.js',
+        'tests/dummy/app/templates/application.hbs',
+        '.github/workflows/ci.yml',
+        'README.md',
+        'CONTRIBUTING.md',
+        '.npmrc',
+      ].forEach((filePath) => {
+        checkFile(filePath, path.join(__dirname, '../fixtures', fixturePath, filePath));
+      });
 
-        expect(file('.travis.yml')).to.not.exist;
+      expect(file('.travis.yml')).to.not.exist;
 
-        checkFileWithEmberCLIVersionReplacement(fixturePath, 'package.json');
-        checkFileWithEmberCLIVersionReplacement(fixturePath, 'tests/dummy/config/ember-cli-update.json');
-      });
-    }
+      checkFileWithEmberCLIVersionReplacement(fixturePath, 'package.json');
+      checkFileWithEmberCLIVersionReplacement(fixturePath, 'tests/dummy/config/ember-cli-update.json');
+    });
 
     it('configurable CI option', async function () {
       await ember(['new', 'foo', '--ci-provider=travis', '--skip-npm', '--skip-git']);