Skip to content

Commit 3e41a78

Browse files
authored
Merge pull request #346 from aws-amplify/master
Release revert of comment
2 parents 3e16134 + d3fbf44 commit 3e41a78

File tree

2 files changed

+91
-256
lines changed

2 files changed

+91
-256
lines changed

packages/amplify-codegen/src/commands/models.js

Lines changed: 1 addition & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -141,9 +141,7 @@ async function generateModels(context) {
141141
appsyncLocalConfig.forEach((cfg, idx) => {
142142
const outPutPath = cfg.filename;
143143
fs.ensureFileSync(outPutPath);
144-
const contentsToWrite = [getVersionsMetadataComment(context), generatedCode[idx]].filter(content => content);
145-
const contentToWrite = contentsToWrite.join('\n\n');
146-
fs.writeFileSync(outPutPath, contentToWrite);
144+
fs.writeFileSync(outPutPath, generatedCode[idx]);
147145
});
148146

149147
generateEslintIgnore(context);
@@ -199,29 +197,6 @@ function getModelOutputPath(context) {
199197
}
200198
}
201199

202-
// Generate a Comment string with Amplify CLI and Amplify Codegen version metadata
203-
function getVersionsMetadataComment(context) {
204-
const versionMetadata = [];
205-
if (context.usageData && context.usageData.version) {
206-
versionMetadata.push('amplify-cli-version: ' + context.usageData.version);
207-
}
208-
209-
if (context.pluginPlatform && context.pluginPlatform.plugins) {
210-
const codegenPluginsInfo = context.pluginPlatform.plugins.codegen;
211-
if (codegenPluginsInfo && codegenPluginsInfo.length > 0) {
212-
const amplifyCodegenPluginInfo = codegenPluginsInfo.filter(plugin => plugin.packageName == 'amplify-codegen');
213-
if (amplifyCodegenPluginInfo && amplifyCodegenPluginInfo.length > 0 && amplifyCodegenPluginInfo[0].packageVersion) {
214-
versionMetadata.push('amplify-codegen-version: ' + amplifyCodegenPluginInfo[0].packageVersion);
215-
}
216-
}
217-
}
218-
219-
if (versionMetadata.length > 0) {
220-
return '// Generated using ' + versionMetadata.join(', ');
221-
}
222-
return null;
223-
}
224-
225200
function generateEslintIgnore(context) {
226201
const projectConfig = context.amplify.getProjectConfig();
227202

0 commit comments

Comments
 (0)