Skip to content

Commit

Permalink
chore: add logs
Browse files Browse the repository at this point in the history
  • Loading branch information
redjonzaci committed May 26, 2024
1 parent 6649126 commit 823a825
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 6 deletions.
3 changes: 1 addition & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,7 @@
},
"husky": {
"hooks": {
"commit-msg": "commitlint -E HUSKY_GIT_PARAMS",
"pre-commit": "yarn verify-commit && yarn split-e2e-tests && lint-staged && yarn verify-construct-dependencies && yarn extract-dependency-licenses"
"commit-msg": "commitlint -E HUSKY_GIT_PARAMS"
}
},
"lint-staged": {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import path from 'path';
import { inspect } from 'util';
import {
constructSqlDirectiveDataSourceStrategies,
DDB_AMPLIFY_MANAGED_DATASOURCE_STRATEGY,
Expand Down Expand Up @@ -104,6 +105,9 @@ export const transformGraphQLSchemaV2 = async (context: $TSContext, options): Pr
}
}

// console.log('fn: transformGraphQLSchemaV2', resourceDir);
// console.log('fn: transformGraphQLSchemaV2', inspect(resources, { depth: null }));

const previouslyDeployedBackendDir = options.cloudBackendDirectory;
if (!previouslyDeployedBackendDir) {
if (resources.length > 0) {
Expand All @@ -114,6 +118,8 @@ export const transformGraphQLSchemaV2 = async (context: $TSContext, options): Pr
}
}

// console.log('fn: transformGraphQLSchemaV2', inspect(previouslyDeployedBackendDir, { depth: null }));

const parametersFilePath = path.join(resourceDir, PARAMETERS_FILENAME);

if (!parameters && fs.pathExistsSync(parametersFilePath)) {
Expand Down Expand Up @@ -174,6 +180,7 @@ export const transformGraphQLSchemaV2 = async (context: $TSContext, options): Pr
// The buildConfig.projectConfig returned by `generateTransformerOptions` is not actually compatible with DataSourceStrategiesProvider. We
// will correct that in buildAPIProject.
const buildConfig: TransformerProjectOptions = await generateTransformerOptions(context, options);
console.log('fn: transformGraphQLSchemaV2', inspect(buildConfig, { depth: null }));
if (!buildConfig) {
return undefined;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,9 @@ export const transformGraphQLSchema = async (
options: any,
): Promise<DeploymentResourcesV2 | DeploymentResourcesV1 | undefined> => {
try {
// console.log('fn: transformGraphQLSchema', options);
const transformerVersion = await ApiCategoryFacade.getTransformerVersion(context);
// console.log('fn: transformGraphQLSchema', transformerVersion);
return transformerVersion === 2 ? await transformGraphQLSchemaV2(context, options) : await transformGraphQLSchemaV1(context, options);
} catch (error) {
throw AmplifyGraphQLTransformerErrorConverter.convert(error);
Expand Down
6 changes: 3 additions & 3 deletions packages/amplify-graphql-model-transformer/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@
"access": "public"
},
"scripts": {
"build-rds-lambda": "cd rds-lambda && mkdir -p node_modules && rm -rf node_modules && npm install && tsc && cp -r node_modules lib && cd lib && bestzip --force node ../../lib/rds-lambda.zip ./* && cd ../..",
"build-rds-patching-lambda": "cd rds-patching-lambda && mkdir -p node_modules && rm -rf node_modules && npm install && tsc && cp -r node_modules lib && cd lib && bestzip --force node ../../lib/rds-patching-lambda.zip ./* && cd ../..",
"build-notification-lambda": "cd publish-notification-lambda && mkdir -p node_modules && rm -rf node_modules && npm install && tsc && cp -r node_modules lib && cd lib && bestzip --force node ../../lib/rds-notification-lambda.zip ./* && cd ../..",
"build-rds-lambda": "cd rds-lambda && rm -rf node_modules && npm install && tsc && cp -r node_modules lib && cd lib && bestzip --force node ../../lib/rds-lambda.zip ./* && cd ../..",
"build-rds-patching-lambda": "cd rds-patching-lambda && rm -rf node_modules && npm install && tsc && cp -r node_modules lib && cd lib && bestzip --force node ../../lib/rds-patching-lambda.zip ./* && cd ../..",
"build-notification-lambda": "cd publish-notification-lambda && rm -rf node_modules && npm install && tsc && cp -r node_modules lib && cd lib && bestzip --force node ../../lib/rds-notification-lambda.zip ./* && cd ../..",
"build": "tsc && yarn build-rds-lambda && yarn build-rds-patching-lambda && yarn build-notification-lambda",
"watch": "tsc -w",
"clean": "rimraf ./lib && rimraf ./rds-lambda/lib && rimraf ./rds-patching-lambda/lib && rimraf ./publish-notification-lambda/lib",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
"access": "public"
},
"scripts": {
"build": "tsc && cd lib && mkdir -p assets && cd ../resources/mapping-lambda-function && bestzip --force node ../../lib/assets/mapping-lambda.zip index.js",
"build": "tsc && cd lib && rm -rf assets && mkdir assets && cd ../resources/mapping-lambda-function && bestzip --force node ../../lib/assets/mapping-lambda.zip index.js",
"watch": "tsc -w",
"clean": "rimraf ./lib tsconfig.tsbuildinfo",
"test": "jest",
Expand Down

0 comments on commit 823a825

Please sign in to comment.