Skip to content

Commit

Permalink
Consolidate types headless (#8698)
Browse files Browse the repository at this point in the history
* fix: consolidate types and auto migrate

* fix: changed package name to extensiblity

* fix: address comments
  • Loading branch information
akshbhu authored and sachscode committed Nov 11, 2021
1 parent f269180 commit 52f676c
Show file tree
Hide file tree
Showing 46 changed files with 594 additions and 548 deletions.
2 changes: 1 addition & 1 deletion .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -323,7 +323,7 @@ module.exports = {
'/packages/amplify-graphql-*transformer*/lib',
'/packages/amplify-provider-awscloudformation/lib',
'/packages/amplify-console-integration-tests/lib',
'/packages/amplify-cli-overrides-helper/lib',
'/packages/amplify-cli-extensibility-helper/lib',
'/packages/amplify-category-auth/resources/auth-custom-resource',
'/packages/amplify-category-custom/lib',
'/packages/amplify-category-custom/resources',
Expand Down
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -69,5 +69,5 @@ packages/**/reports/junit/*
test.out.log
*.tsbuildinfo
packages/amplify-graphiql-explorer/.eslintcache
packages/amplify-cli-overrides-helper/lib
packages/amplify-cli-extensibility-helper/lib

3 changes: 2 additions & 1 deletion packages/amplify-category-auth/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,8 @@
"ora": "^4.0.3",
"promise-sequential": "^1.1.1",
"uuid": "^3.4.0",
"vm2": "^3.9.3"
"vm2": "^3.9.3",
"@aws-amplify/cli-extensibility-helper": "1.0.0"
},
"devDependencies": {
"rimraf": "^3.0.2"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
import { AmplifyAuthCognitoStackTemplate } from '@aws-amplify/cli-overrides-helper';
import { AmplifyAuthCognitoStackTemplate } from '@aws-amplify/cli-extensibility-helper';

export function override(resources: AmplifyAuthCognitoStackTemplate) {}
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"test": "echo \"Error: no test specified\" && exit 1"
},
"dependencies": {
"@aws-amplify/cli-overrides-helper": "1.1.0-ext11.0"
"@aws-amplify/cli-extensibility-helper": "1.1.0-ext15.0"
},
"devDependencies": {
"typescript": "^4.2.4"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,9 @@ describe('auth update: ', () => {
usageData: {
emitError: jest.fn(),
},
input: {
options: {},
},
} as unknown as $TSContext;
const dependencies = ['analytics', 'api', 'function', 'storage'];

Expand Down
3 changes: 0 additions & 3 deletions packages/amplify-category-auth/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,6 @@ const { AuthParameters } = require('./provider-utils/awscloudformation/import/ty
const { getSupportedServices } = require('./provider-utils/supported-services');
const { generateAuthStackTemplate } = require('./provider-utils/awscloudformation/utils/generate-auth-stack-template');
const { AmplifyAuthTransform, AmplifyUserPoolGroupTransform } = require('./provider-utils/awscloudformation/auth-stack-builder');
const { AmplifyAuthCognitoStackTemplate } = require('./provider-utils/awscloudformation/auth-stack-builder/types');

const {
doesConfigurationIncludeSMS,
loadResourceParameters,
Expand Down Expand Up @@ -534,5 +532,4 @@ module.exports = {
AmplifyAuthTransform,
AmplifyUserPoolGroupTransform,
transformCategoryStack,
AmplifyAuthCognitoStackTemplate,
};
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import * as s3 from '@aws-cdk/aws-s3';
import * as iam from '@aws-cdk/aws-iam';
import * as cognito from '@aws-cdk/aws-cognito';
import * as lambda from '@aws-cdk/aws-lambda';
import { AmplifyAuthCognitoStackTemplate } from './types';
import { AmplifyAuthCognitoStackTemplate } from '@aws-amplify/cli-extensibility-helper';
import { CognitoStackOptions } from '../service-walkthrough-types/cognito-user-input-types';
import _ from 'lodash';
import {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import * as cdk from '@aws-cdk/core';
import * as iam from '@aws-cdk/aws-iam';
import * as lambda from '@aws-cdk/aws-lambda';
import { CfnUserPoolGroup } from '@aws-cdk/aws-cognito';
import { AmplifyUserPoolGroupStackTemplate } from './types';
import { AmplifyUserPoolGroupStackTemplate } from '@aws-amplify/cli-extensibility-helper';
import { AmplifyUserPoolGroupStackOptions } from './user-pool-group-stack-transform';
import { AmplifyStackTemplate } from 'amplify-cli-core';
import * as fs from 'fs-extra';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,3 @@ export { AmplifyAuthCognitoStack } from './auth-cognito-stack-builder';
export { AmplifyAuthTransform } from './auth-stack-transform';
export { AmplifyUserPoolGroupStack } from './auth-user-pool-group-stack-builder';
export { AmplifyUserPoolGroupTransform } from './user-pool-group-stack-transform';
export { AmplifyAuthCognitoStackTemplate, AmplifyUserPoolGroupStackTemplate } from './types';
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import {
} from '../service-walkthrough-types/awsCognito-user-input-types';

export const migrateResourceToSupportOverride = async (resourceName: string) => {
printer.info('Starting Migration Process');
printer.debug('Starting Migration Process');
/**
* backup resource folder
* get parameters.json
Expand Down Expand Up @@ -48,7 +48,7 @@ export const migrateResourceToSupportOverride = async (resourceName: string) =>
const cliInputs = mapParametersJsonToCliInputs(parameters!);
const cliInputsPath = path.join(authresourceDirPath, 'cli-inputs.json');
JSONUtilities.writeJson(cliInputsPath, cliInputs);
printer.success('Migration is Successful');
printer.debug('Migration is Successful');
} catch (e) {
printer.error('There was an error migrating your project.');
rollback(authresourceDirPath, backupAuthResourceFolder!);
Expand Down
3 changes: 2 additions & 1 deletion packages/amplify-category-storage/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,8 @@
"lodash": "^4.17.21",
"promise-sequential": "^1.1.1",
"uuid": "^8.3.2",
"vm2": "^3.9.3"
"vm2": "^3.9.3",
"@aws-amplify/cli-extensibility-helper": "1.0.0"
},
"devDependencies": {
"aws-sdk": "^2.963.0",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
import { AmplifyDDBResourceTemplate } from '@aws-amplify/cli-overrides-helper';
import { AmplifyDDBResourceTemplate } from '@aws-amplify/cli-extensibility-helper';

export function override(resources: AmplifyDDBResourceTemplate) {}
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"test": "echo \"Error: no test specified\" && exit 1"
},
"dependencies": {
"@aws-amplify/cli-overrides-helper": "1.1.0-ext11.0"
"@aws-amplify/cli-extensibility-helper": "1.1.0-ext15.0"

},
"devDependencies": {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
import { AmplifyS3ResourceTemplate } from '@aws-amplify/cli-overrides-helper';
import { AmplifyS3ResourceTemplate } from '@aws-amplify/cli-extensibility-helper';

export function override(resources: AmplifyS3ResourceTemplate) {}
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"test": "echo \"Error: no test specified\" && exit 1"
},
"dependencies": {
"@aws-amplify/cli-overrides-helper": "1.1.0-ext11.0"
"@aws-amplify/cli-extensibility-helper": "1.1.0-ext15.0"
},
"devDependencies": {
"typescript": "^4.2.4"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,9 @@ describe('add ddb walkthrough tests', () => {
};
},
},
input: {
options: {},
},
} as unknown as $TSContext;
});

Expand Down Expand Up @@ -126,6 +129,9 @@ describe('update ddb walkthrough tests', () => {
};
},
},
input: {
options: {},
},
} as unknown as $TSContext;
});

Expand Down
Loading

0 comments on commit 52f676c

Please sign in to comment.