Skip to content

chore(maintenance): migrate jmespath utility to biome #2807

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Jul 22, 2024
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 37 additions & 0 deletions biome.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
{
"$schema": "https://biomejs.dev/schemas/1.8.3/schema.json",
"organizeImports": {
"enabled": true
},
"linter": {
"enabled": true,
"rules": {
"recommended": true
}
},
"formatter": {
"enabled": true,
"indentStyle": "space",
"indentWidth": 2,
"lineEnding": "lf",
"lineWidth": 80
},
"javascript": {
"formatter": {
"semicolons": "always",
"bracketSpacing": true,
"quoteStyle": "single",
"trailingCommas": "es5"
}
},
"files": {
"ignore": [
"node_modules",
"coverage",
"lib",
"cdk.out",
"site",
".aws-sam"
]
}
}
4 changes: 2 additions & 2 deletions examples/app/cdk/example-stack.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { RemovalPolicy, Stack, StackProps } from 'aws-cdk-lib';
import { RemovalPolicy, Stack, type StackProps } from 'aws-cdk-lib';
import { LambdaIntegration, RestApi } from 'aws-cdk-lib/aws-apigateway';
import {
AttributeType,
Expand All @@ -18,7 +18,7 @@ import { DynamoEventSource } from 'aws-cdk-lib/aws-lambda-event-sources';
import { OutputFormat } from 'aws-cdk-lib/aws-lambda-nodejs';
import { Queue } from 'aws-cdk-lib/aws-sqs';
import { StringParameter } from 'aws-cdk-lib/aws-ssm';
import { Construct } from 'constructs';
import type { Construct } from 'constructs';
import { FunctionWithLogGroup } from './function-with-logstream-construct.js';

export class PowertoolsExampleStack extends Stack {
Expand Down
4 changes: 2 additions & 2 deletions examples/app/functions/commons/helpers/get-item.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { GetCommand, type GetCommandOutput } from '@aws-sdk/lib-dynamodb';
import { docClient } from '#clients/dynamodb';
import { itemsTableName } from '#constants';
import type { DebugLogger } from '#types';
import { GetCommand, type GetCommandOutput } from '@aws-sdk/lib-dynamodb';

/**
* Fetch an item from the DynamoDB table.
Expand All @@ -22,7 +22,7 @@ const getItemDynamoDB = async (
})
);

logger.debug(`ddb response`, {
logger.debug('ddb response', {
response,
});

Expand Down
6 changes: 3 additions & 3 deletions examples/app/functions/commons/helpers/put-item.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { randomUUID } from 'node:crypto';
import { PutCommand } from '@aws-sdk/lib-dynamodb';
import { docClient } from '#clients/dynamodb';
import { itemsTableName } from '#constants';
import type { DebugLogger } from '#types';
import { PutCommand } from '@aws-sdk/lib-dynamodb';
import { randomUUID } from 'node:crypto';

/**
* Put an item in the DynamoDB table.
Expand All @@ -28,7 +28,7 @@ const putItemInDynamoDB = async (
})
);

logger.debug(`ddb response`, {
logger.debug('ddb response', {
response,
});

Expand Down
4 changes: 2 additions & 2 deletions examples/app/functions/commons/helpers/scan-items.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { ScanCommand, type ScanCommandOutput } from '@aws-sdk/lib-dynamodb';
import { docClient } from '#clients/dynamodb';
import { itemsTableName } from '#constants';
import type { DebugLogger } from '#types';
import { ScanCommand, type ScanCommandOutput } from '@aws-sdk/lib-dynamodb';

/**
* Scan the DynamoDB table and return all items.
Expand All @@ -19,7 +19,7 @@ const scanItemsDynamoDB = async (
})
);

logger.debug(`ddb response`, {
logger.debug('ddb response', {
response,
});

Expand Down
10 changes: 3 additions & 7 deletions examples/app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,12 @@
"scripts": {
"build": "echo 'Not applicable, run `npx cdk synth` instead to build the stack'",
"test": "npm run test:unit",
"lint": "eslint --ext .ts,.js --no-error-on-unmatched-pattern .",
"lint-fix": "eslint --fix --ext .ts,.js --fix --no-error-on-unmatched-pattern .",
"lint": "biome lint .",
"lint:fix": "biome check --write .",
"test:unit": "export POWERTOOLS_DEV=true && jest --silent",
"test:e2e": "echo 'To be implemented ...'",
"cdk": "cdk"
},
"lint-staged": {
"*.ts": "npm run lint-fix",
"*.js": "npm run lint-fix"
},
"type": "module",
"imports": {
"#types": "./functions/commons/types.js",
Expand Down Expand Up @@ -64,4 +60,4 @@
"ts-node": "^10.9.2",
"typescript": "^5.4.5"
}
}
}
156 changes: 156 additions & 0 deletions package-lock.json

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

5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@
},
"homepage": "https://github.com/aws-powertools/powertools-lambda-typescript#readme",
"devDependencies": {
"@biomejs/biome": "^1.8.3",
"@types/aws-lambda": "^8.10.141",
"@types/jest": "^29.5.12",
"@types/node": "^20.14.10",
Expand Down Expand Up @@ -77,7 +78,7 @@
"typescript": "^5.4.5"
},
"lint-staged": {
"*.{js,ts}": "eslint --fix",
"*.{js,ts}": "biome check --write",
"*.md": "markdownlint-cli2 --fix"
},
"engines": {
Expand All @@ -88,4 +89,4 @@
"tar": "6.2.1"
}
}
}
}
18 changes: 5 additions & 13 deletions packages/jmespath/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@
"build:cjs": "tsc --build tsconfig.json && echo '{ \"type\": \"commonjs\" }' > lib/cjs/package.json",
"build:esm": "tsc --build tsconfig.esm.json && echo '{ \"type\": \"module\" }' > lib/esm/package.json",
"build": "npm run build:esm & npm run build:cjs",
"lint": "eslint --ext .ts,.js --no-error-on-unmatched-pattern .",
"lint-fix": "eslint --fix --ext .ts,.js --no-error-on-unmatched-pattern .",
"lint": "biome lint .",
"lint:fix": "biome check --write .",
"prepack": "node ../../.github/scripts/release_patch_package_json.js ."
},
"homepage": "https://github.com/aws-powertools/powertools-lambda-typescript",
Expand Down Expand Up @@ -51,25 +51,17 @@
},
"typesVersions": {
"*": {
"envelopes": [
"lib/cjs/envelopes.d.ts",
"lib/esm/envelopes.d.ts"
],
"envelopes": ["lib/cjs/envelopes.d.ts", "lib/esm/envelopes.d.ts"],
"functions": [
"lib/cjs/PowertoolsFunctions.d.ts",
"lib/esm/PowertoolsFunctions.d.ts"
],
"types": [
"lib/cjs/types.d.ts",
"lib/esm/types.d.ts"
]
"types": ["lib/cjs/types.d.ts", "lib/esm/types.d.ts"]
}
},
"types": "./lib/cjs/index.d.ts",
"main": "./lib/cjs/index.js",
"files": [
"lib"
],
"files": ["lib"],
"dependencies": {
"@aws-lambda-powertools/commons": "^2.5.0"
},
Expand Down
Loading