Skip to content

Commit 13ec0c4

Browse files
sarageriondreamorosi
authored andcommitted
fix: version command refactor
1 parent 652b7f0 commit 13ec0c4

File tree

10 files changed

+26
-41
lines changed

10 files changed

+26
-41
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
name: On PR code update
2+
3+
on:
4+
pull_request:
5+
types: [opened, synchronize]
6+
jobs:
7+
run-linting-check-and-unit-tests:
8+
uses: ./.github/workflows/reusable-run-linting-check-and-unit-tests.yml

.github/workflows/pr_lint_and_test.yml

-8
This file was deleted.

.github/workflows/reusable-run-unit-tests.yml renamed to .github/workflows/reusable-run-linting-check-and-unit-tests.yml

+6-2
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ on:
44
workflow_call:
55

66
jobs:
7-
run-unit-tests-on-utils:
7+
run-linting-check-and-unit-tests:
88
runs-on: ubuntu-latest
99
env:
1010
NODE_ENV: dev
@@ -43,7 +43,7 @@ jobs:
4343
run: |
4444
npm run build -w packages/commons
4545
npm run build -w packages/logger & npm run build -w packages/tracer & npm run build -w packages/metrics
46-
- name: Lint
46+
- name: Run linting
4747
run: npm run lint -w packages/commons -w packages/logger -w packages/tracer -w packages/metrics
4848
- name: Run unit tests
4949
run: npm t -w packages/commons -w packages/logger -w packages/tracer -w packages/metrics
@@ -80,6 +80,8 @@ jobs:
8080
# We can skip the install if there was a cache hit
8181
if: steps.cache-node-modules.outputs.cache-hit != 'true'
8282
run: npm ci
83+
- name: Run linting
84+
run: npm run lint
8385
- name: Run tests
8486
run: npm t
8587
check-layer-publisher:
@@ -108,3 +110,5 @@ jobs:
108110
# We can skip the install if there was a cache hit
109111
if: steps.cache-node-modules.outputs.cache-hit != 'true'
110112
run: npm ci
113+
- name: Run linting
114+
run: npm run lint

.husky/pre-push

-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
#!/bin/sh
22
. "$(dirname "$0")/_/husky.sh"
33

4-
npm run lerna-lint-fix
54
npm run test

package.json

+3-6
Original file line numberDiff line numberDiff line change
@@ -15,20 +15,17 @@
1515
"test": "npm run lerna-test",
1616
"commit": "commit",
1717
"package": "npm run package",
18-
"setup-local": "npm ci --foreground-scripts && cd examples/cdk && npm ci && cd ../.. && cd examples/sam && npm ci && cd ../.. && npm run init-environment",
18+
"setup-local": "npm ci --foreground-scripts && cd examples/cdk && npm ci && cd ../../examples/sam && npm ci && cd ../../layer-publisher && npm ci && cd ../.. && npm run init-environment",
1919
"lerna-test": "lerna exec -- npm run test",
2020
"lerna-test:unit": "lerna exec -- npm run test:unit",
2121
"lerna-test:e2e": "lerna exec -- npm run test:e2e",
2222
"lerna-package": "lerna exec -- npm run package",
2323
"lerna-package-bundle": "lerna exec -- npm run package-bundle",
24-
"lerna-build": "lerna exec -- tsc",
24+
"lerna-build": "lerna exec -- npm run build",
2525
"lerna-lint": "lerna exec -- npm run lint",
2626
"lerna-lint-fix": "lerna exec -- npm run lint-fix",
2727
"lerna-prepare": "lerna exec -- npm run build",
28-
"lerna-prepublishOnly": "lerna exec -- npm test && lerna exec -- npm run lint",
29-
"lerna-preversion": "lerna exec -- npm run lint",
30-
"lerna-version": "lerna exec -- npm run lint-fix && git add -A src",
31-
"postversion": "git push && git push --tags",
28+
"postversion": "git push --tags",
3229
"docs-website-build-run": "npm run docs-buildDockerImage && npm run docs-runLocalDocker",
3330
"docs-buildDockerImage": "docker build -t powertool-typescript/docs ./docs/",
3431
"docs-runLocalDocker": "docker run --rm -it -p 8000:8000 -v ${PWD}:/docs powertool-typescript/docs",

packages/commons/package.json

+2-5
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,7 @@
2121
"package": "mkdir -p dist/ && npm pack && mv *.tgz dist/",
2222
"package-bundle": "../../package-bundler.sh commons-bundle ./dist",
2323
"prepare": "npm run build",
24-
"prepublishOnly": "npm test && npm run lint",
25-
"preversion": "npm run lint",
26-
"version": "npm run lint-fix && git add -A src",
27-
"postversion": "git push && git push --tags"
24+
"postversion": "git push --tags"
2825
},
2926
"homepage": "https://github.com/awslabs/aws-lambda-powertools-typescript/tree/master/packages/metrics#readme",
3027
"license": "MIT-0",
@@ -48,4 +45,4 @@
4845
"serverless",
4946
"nodejs"
5047
]
51-
}
48+
}

packages/idempotency/package.json

+1-4
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,7 @@
2424
"package": "mkdir -p dist/ && npm pack && mv *.tgz dist/",
2525
"package-bundle": "../../package-bundler.sh logger-bundle ./dist",
2626
"prepare": "npm run build",
27-
"prepublishOnly": "npm test && npm run lint",
28-
"preversion": "npm run lint",
29-
"version": "npm run lint-fix && git add -A src",
30-
"postversion": "git push && git push --tags"
27+
"postversion": "git push --tags"
3128
},
3229
"homepage": "https://github.com/awslabs/aws-lambda-powertools-typescript/tree/master/packages/idempotency#readme",
3330
"license": "MIT",

packages/logger/package.json

+2-5
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,7 @@
2424
"package": "mkdir -p dist/ && npm pack && mv *.tgz dist/",
2525
"package-bundle": "../../package-bundler.sh logger-bundle ./dist",
2626
"prepare": "npm run build",
27-
"prepublishOnly": "npm test && npm run lint",
28-
"preversion": "npm run lint",
29-
"version": "npm run lint-fix && git add -A src",
30-
"postversion": "git push && git push --tags"
27+
"postversion": "git push --tags"
3128
},
3229
"homepage": "https://github.com/awslabs/aws-lambda-powertools-typescript/tree/master/packages/logging#readme",
3330
"license": "MIT",
@@ -64,4 +61,4 @@
6461
"serverless",
6562
"nodejs"
6663
]
67-
}
64+
}

packages/metrics/package.json

+2-5
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,7 @@
2424
"package": "mkdir -p dist/ && npm pack && mv *.tgz dist/",
2525
"package-bundle": "../../package-bundler.sh metrics-bundle ./dist",
2626
"prepare": "npm run build",
27-
"prepublishOnly": "npm test && npm run lint",
28-
"preversion": "npm run lint",
29-
"version": "npm run lint-fix && git add -A src",
30-
"postversion": "git push && git push --tags"
27+
"postversion": "git push --tags"
3128
},
3229
"homepage": "https://github.com/awslabs/aws-lambda-powertools-typescript/tree/master/packages/metrics#readme",
3330
"license": "MIT-0",
@@ -59,4 +56,4 @@
5956
"serverless",
6057
"nodejs"
6158
]
62-
}
59+
}

packages/tracer/package.json

+2-5
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,7 @@
2222
"lint": "eslint --ext .ts --no-error-on-unmatched-pattern src tests",
2323
"lint-fix": "eslint --fix --ext .ts --no-error-on-unmatched-pattern src tests",
2424
"prepare": "npm run build",
25-
"prepublishOnly": "npm test && npm run lint",
26-
"preversion": "npm run lint",
27-
"version": "npm run lint-fix && git add -A src",
28-
"postversion": "git push && git push --tags",
25+
"postversion": "git push --tags",
2926
"package": "mkdir -p dist/ && npm pack && mv *.tgz dist/",
3027
"package-bundle": "../../package-bundler.sh tracer-bundle ./dist"
3128
},
@@ -62,4 +59,4 @@
6259
"serverless",
6360
"nodejs"
6461
]
65-
}
62+
}

0 commit comments

Comments
 (0)