Skip to content

Commit

Permalink
fix(galileo-cli): handle outdated aws creds error; fix eslint-staged
Browse files Browse the repository at this point in the history
  • Loading branch information
sperka committed Oct 31, 2023
1 parent b61e82f commit a4e31ab
Show file tree
Hide file tree
Showing 20 changed files with 46 additions and 33 deletions.
2 changes: 1 addition & 1 deletion .projen/tasks.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion demo/api/generated/runtime/python/poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion demo/api/interceptors/typescript/.projen/tasks.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions demo/corpus/embeddings/poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion demo/corpus/logic/.projen/tasks.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion demo/infra/.projen/tasks.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion demo/sample-dataset/.projen/tasks.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion demo/website/.projen/tasks.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion packages/galileo-cdk/.projen/tasks.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions packages/galileo-cli/.projen/deps.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions packages/galileo-cli/.projen/tasks.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 11 additions & 0 deletions packages/galileo-cli/bin/galileo-cli.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
PDX-License-Identifier: Apache-2.0 */
import * as path from "node:path";
import { run, flush, Errors } from "@oclif/core";
import { CredentialsProviderError } from "@smithy/property-provider";
import chalk from "chalk";

// https://oclif.io/docs/config
process.env.XDG_DATA_HOME = path.join(__dirname, "..");
Expand All @@ -12,6 +14,15 @@ void (async () => {
await run();
await flush();
} catch (err: any) {
// handle error when aws creds are outdated
if (err instanceof CredentialsProviderError) {
console.error(
chalk.redBright(
"\n\nSeems your AWS credentials are outdated. Please update them and try again.\n\n"
)
);
}

Errors.handle(err);
}
})();
1 change: 1 addition & 0 deletions packages/galileo-cli/examples/csv-loader/parser-common.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,5 +49,6 @@ export const parseCsv = (): DocumentMetadata => {
return docMetadata;
} catch (err) {
console.log(JSON.stringify(err));
throw err;
}
};
1 change: 1 addition & 0 deletions packages/galileo-cli/package.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions packages/galileo-cli/tsconfig.dev.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions packages/galileo-cli/tsconfig.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion packages/galileo-sdk/.projen/tasks.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

19 changes: 7 additions & 12 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 3 additions & 2 deletions projenrc/framework/galileo-cli.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ export class GalileoCli extends TypeScriptAppProject {
outDir: undefined,
target: "ES2022",
},
include: ["src/**/*.ts", "examples/**/*.ts"],
include: ["examples/**/*.ts", "bin/*.ts"],
};

super({
Expand All @@ -44,8 +44,9 @@ export class GalileoCli extends TypeScriptAppProject {
`@aws-sdk/client-sfn@^${VERSIONS.AWS_SDK}`,
`@aws-sdk/client-ssm@^${VERSIONS.AWS_SDK}`,
`@aws-sdk/client-sts@^${VERSIONS.AWS_SDK}`,
`@aws-sdk/lib-storage@^${VERSIONS.AWS_SDK}`,
`@aws-sdk/credential-providers@^${VERSIONS.AWS_SDK}`,
`@aws-sdk/lib-storage@^${VERSIONS.AWS_SDK}`,
`@smithy/property-provider`,
"@oclif/core",
"@oclif/errors",
"chalk@^4",
Expand Down
2 changes: 1 addition & 1 deletion projenrc/monorepo.ts
Original file line number Diff line number Diff line change
Expand Up @@ -288,7 +288,7 @@ export class MonorepoProject extends MonorepoTsProject {
description: "Run eslint against the staged files only",
steps: [
{
exec: `eslint --fix --no-error-on-unmatched-pattern $(git diff --name-only --relative --staged HEAD . | grep -E '^(.*/)?(${dirs.join(
exec: `eslint --fix --no-error-on-unmatched-pattern $(git diff --name-only --relative --staged HEAD . | grep -E '^(${dirs.join(
"|"
)})/.*\.(ts|tsx)$' | xargs)`,
},
Expand Down

0 comments on commit a4e31ab

Please sign in to comment.