Skip to content

Commit 31978f8

Browse files
authored
Deprecate root level template.json keys (facebook#11188)
1 parent 4798ba6 commit 31978f8

File tree

1 file changed

+4
-11
lines changed

1 file changed

+4
-11
lines changed

scripts/init.js

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -126,24 +126,17 @@ module.exports = function (
126126

127127
const templatePackage = templateJson.package || {};
128128

129-
// TODO: Deprecate support for root-level `dependencies` and `scripts` in v5.
130-
// These should now be set under the `package` key.
129+
// This was deprecated in CRA v5.
131130
if (templateJson.dependencies || templateJson.scripts) {
132131
console.log();
133132
console.log(
134-
chalk.yellow(
135-
'Root-level `dependencies` and `scripts` keys in `template.json` are deprecated.\n' +
136-
'This template should be updated to use the new `package` key.'
133+
chalk.red(
134+
'Root-level `dependencies` and `scripts` keys in `template.json` were deprecated for Create React App 5.\n' +
135+
'This template needs to be updated to use the new `package` key.'
137136
)
138137
);
139138
console.log('For more information, visit https://cra.link/templates');
140139
}
141-
if (templateJson.dependencies) {
142-
templatePackage.dependencies = templateJson.dependencies;
143-
}
144-
if (templateJson.scripts) {
145-
templatePackage.scripts = templateJson.scripts;
146-
}
147140

148141
// Keys to ignore in templatePackage
149142
const templatePackageBlacklist = [

0 commit comments

Comments
 (0)