Skip to content

Commit

Permalink
Removed dead code and updated changes
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisradek committed Sep 9, 2016
1 parent a7f7882 commit bc1d2fa
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 44 deletions.
5 changes: 5 additions & 0 deletions .changes/next-release/feature-Tools-99c09de2.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"type": "feature",
"category": "Tools",
"description": "Adds support for bundling the SDK with webpack. Also adds support for creating node.js bundles using webpack or browserify."
}
43 changes: 0 additions & 43 deletions dist-tools/client-creator.js
Original file line number Diff line number Diff line change
Expand Up @@ -66,49 +66,6 @@ ClientCreator.prototype.customizationsExist = function customizationsExist(servi
return fs.existsSync(path.join(customizationsFolder, serviceName + '.js'));
};

ClientCreator.prototype.generateClientStub = function generateClientStub(serviceMetadata, specifiedVersion) {
var className = serviceMetadata.name;
var serviceName = className.toLowerCase();
var modelName = serviceMetadata.prefix || serviceName;
specifiedVersion = specifiedVersion || '*';

// get models for the service
var models = this.getAllApiFilenamesForService(modelName);

var modelVersions = models && models.versions;
if (!modelVersions) {
throw new Error('Unable to get models for ' + modelName);
}
var versionNumbers = Object.keys(modelVersions);
var code = '';
code += 'AWS.apiLoader.services[\'' + serviceName +'\'] = {};\n';
code += 'AWS.' + className + ' = Service.defineService(\'' + serviceName + '\', [\'' + versionNumbers.join('\', \'') + '\']);\n';
// pull in service customizations
if (this.customizationsExist(serviceName)) {
code += 'require(\'../lib/services/' + serviceName + '\');\n';
}
versionNumbers.forEach(function(version) {
// check version
if (specifiedVersion !== '*' && specifiedVersion !== version) {
return;
}
var versionInfo = modelVersions[version];
if (!versionInfo.hasOwnProperty('api')) {
throw new Error('No API model for ' + serviceName + '-' + version);
}
var loaderPrefix = 'AWS.apiLoader.services[\'' + serviceName + '\'][\'' + version + '\']';
code += '\n';
code += loaderPrefix + ' = require(\'../apis/' + versionInfo.api + '.json\');\n';
if (versionInfo.hasOwnProperty('paginators')) {
code += loaderPrefix + '.paginators = require(\'../apis/' + versionInfo.paginators + '.json\').pagination;\n';
}
if (versionInfo.hasOwnProperty('waiters')) {
code += loaderPrefix + '.waiters = require(\'../apis/' + versionInfo.waiters + '.json\').waiters;\n';
}
});
return code;
}

ClientCreator.prototype.generateClientFileSource = function generateClientFileSource(serviceMetadata, specifiedVersion) {
var clientFolderPath = this._clientFolderPath;
var className = serviceMetadata.name;
Expand Down
1 change: 0 additions & 1 deletion dist-tools/service-collector.js
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,6 @@ function ServiceCollector(services) {
if (!builtServices[service]) {
builtServices[service] = {};

//lines = clientCreator.generateClientStub(metadata[service], version);
lines = getServiceHeader(service);
if (lines === null) {
if (!usingDefaultServices) {
Expand Down
3 changes: 3 additions & 0 deletions lib/api_loader.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
var AWS = require('./core');

AWS.apiLoader = function(svc, version) {
if (!AWS.apiLoader.services.hasOwnProperty(svc)) {
throw new Error('InvalidService: Failed to load api for ' + svc);
}
return AWS.apiLoader.services[svc][version];
};

Expand Down

0 comments on commit bc1d2fa

Please sign in to comment.