Skip to content

Commit

Permalink
Merge branch 'main' into prefer-amplify-errors
Browse files Browse the repository at this point in the history
  • Loading branch information
Vieltojarvi committed Sep 10, 2024
2 parents e9e15bc + c10f6fc commit e36d96f
Show file tree
Hide file tree
Showing 14 changed files with 46 additions and 22 deletions.
2 changes: 0 additions & 2 deletions .changeset/famous-files-laugh.md

This file was deleted.

5 changes: 0 additions & 5 deletions .changeset/flat-hounds-speak.md

This file was deleted.

6 changes: 6 additions & 0 deletions .changeset/happy-adults-think.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
'@aws-amplify/schema-generator': patch
'@aws-amplify/model-generator': patch
---

activated no-amplify-errors, ignored lines with valid violations
5 changes: 0 additions & 5 deletions .changeset/happy-starfishes-trade.md

This file was deleted.

5 changes: 0 additions & 5 deletions .changeset/small-gorillas-remain.md

This file was deleted.

6 changes: 6 additions & 0 deletions packages/ai-constructs/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# @aws-amplify/ai-constructs

## 0.1.3

### Patch Changes

- 041d041: Do not bundle AWS SDK if default implementation is used

## 0.1.2

### Patch Changes
Expand Down
2 changes: 1 addition & 1 deletion packages/ai-constructs/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@aws-amplify/ai-constructs",
"version": "0.1.2",
"version": "0.1.3",
"type": "commonjs",
"publishConfig": {
"access": "public"
Expand Down
6 changes: 6 additions & 0 deletions packages/backend-deployer/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# @aws-amplify/backend-deployer

## 1.1.1

### Patch Changes

- 1505414: surface synth errors if the function declaration files have not been written yet.

## 1.1.0

### Minor Changes
Expand Down
2 changes: 1 addition & 1 deletion packages/backend-deployer/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@aws-amplify/backend-deployer",
"version": "1.1.0",
"version": "1.1.1",
"type": "module",
"publishConfig": {
"access": "public"
Expand Down
8 changes: 8 additions & 0 deletions packages/cli/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
# @aws-amplify/backend-cli

## 1.2.6

### Patch Changes

- ab09375: throw user error when sandbox identifier validation fails
- Updated dependencies [1505414]
- @aws-amplify/backend-deployer@1.1.1

## 1.2.5

### Patch Changes
Expand Down
4 changes: 2 additions & 2 deletions packages/cli/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@aws-amplify/backend-cli",
"version": "1.2.5",
"version": "1.2.6",
"description": "Command line interface for various Amplify tools",
"bin": {
"ampx": "lib/ampx.js",
Expand Down Expand Up @@ -30,7 +30,7 @@
},
"homepage": "https://github.com/aws-amplify/amplify-backend#readme",
"dependencies": {
"@aws-amplify/backend-deployer": "^1.1.0",
"@aws-amplify/backend-deployer": "^1.1.1",
"@aws-amplify/backend-output-schemas": "^1.1.0",
"@aws-amplify/backend-secret": "^1.1.0",
"@aws-amplify/cli-core": "^1.1.2",
Expand Down
10 changes: 9 additions & 1 deletion packages/eslint-rules/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,15 @@ export const configs = {
},
},
{
files: ['packages/auth-construct/src/**'],
files: [
'packages/auth-construct/src/**',
'packages/ai-constructs/src/**',
'packages/backend-output-storage/src/**',
'packages/deployed-backend-client/src/**',
'packages/form-generator/src/**',
'packages/model-generator/src/**',
'packages/schema-generator/src/**',
],
rules: {
'amplify-backend-rules/no-amplify-errors': 'error',
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ export const getBackendOutputWithErrorHandling = async (
error instanceof BackendOutputClientError &&
error.code === BackendOutputClientErrorType.DEPLOYMENT_IN_PROGRESS
) {
// eslint-disable-next-line amplify-backend-rules/no-amplify-errors
throw new AmplifyUserError(
'DeploymentInProgressError',
{
Expand All @@ -33,6 +34,7 @@ export const getBackendOutputWithErrorHandling = async (
error instanceof BackendOutputClientError &&
error.code === BackendOutputClientErrorType.NO_STACK_FOUND
) {
// eslint-disable-next-line amplify-backend-rules/no-amplify-errors
throw new AmplifyUserError(
'StackDoesNotExistError',
{
Expand All @@ -47,6 +49,7 @@ export const getBackendOutputWithErrorHandling = async (
error instanceof BackendOutputClientError &&
error.code === BackendOutputClientErrorType.CREDENTIALS_ERROR
) {
// eslint-disable-next-line amplify-backend-rules/no-amplify-errors
throw new AmplifyUserError(
'CredentialsError',
{
Expand All @@ -61,6 +64,7 @@ export const getBackendOutputWithErrorHandling = async (
error instanceof BackendOutputClientError &&
error.code === BackendOutputClientErrorType.ACCESS_DENIED
) {
// eslint-disable-next-line amplify-backend-rules/no-amplify-errors
throw new AmplifyUserError(
'AccessDeniedError',
{
Expand Down
3 changes: 3 additions & 0 deletions packages/schema-generator/src/generate_schema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ export class SchemaGenerator {
} catch (err) {
const databaseError = err as DatabaseConnectError;
if (databaseError.code === 'ETIMEDOUT') {
// eslint-disable-next-line amplify-backend-rules/no-amplify-errors
throw new AmplifyUserError<AmplifyGenerateSchemaError>(
'DatabaseConnectionError',
{
Expand Down Expand Up @@ -117,6 +118,7 @@ export const parseDatabaseUrl = (databaseUrl: string): SQLDataSourceConfig => {
).filter((part) => !config[part]);

if (missingParts.length > 0) {
// eslint-disable-next-line amplify-backend-rules/no-amplify-errors
throw new AmplifyUserError<AmplifyGenerateSchemaError>(
'DatabaseUrlParseError',
{
Expand All @@ -132,6 +134,7 @@ export const parseDatabaseUrl = (databaseUrl: string): SQLDataSourceConfig => {
return config;
} catch (err) {
const error = err as Error;
// eslint-disable-next-line amplify-backend-rules/no-amplify-errors
throw new AmplifyUserError<AmplifyGenerateSchemaError>(
'DatabaseUrlParseError',
{
Expand Down

0 comments on commit e36d96f

Please sign in to comment.