Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/v5-stable' into fix-12450
Browse files Browse the repository at this point in the history
  • Loading branch information
AllanZhengYP committed Nov 6, 2023
2 parents b3d6836 + 51e97ea commit 38904db
Show file tree
Hide file tree
Showing 16 changed files with 206 additions and 93 deletions.
2 changes: 1 addition & 1 deletion .github/actions/setup-samples-staging/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ runs:
env:
BRANCH: ${{ github.ref_name }}
run: |
if git ls-remote origin $BRANCH | grep -q refs/heads/next/$BRANCH$; then
if git ls-remote origin $BRANCH | grep -q refs/heads/$BRANCH$; then
# Branch exists, checkout and echo success message
git fetch origin $BRANCH
git checkout $BRANCH
Expand Down
52 changes: 52 additions & 0 deletions .github/workflows/callable-npm-publish-lts-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
name: Release LTS version to npm and update repository

on:
workflow_call:
inputs:
target:
required: true
type: string

jobs:
deploy:
name: Publish to Amplify Package
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@24cb9080177205b6e8c946b17badbe402adc938f # v3.4.0 https://github.com/actions/checkout/commit/24cb9080177205b6e8c946b17badbe402adc938f
with:
path: amplify-js
token: ${{ secrets.GH_TOKEN_AMPLIFY_JS_WRITE }}

- name: Setup node and build the repository
uses: ./amplify-js/.github/actions/node-and-build

- name: Run npm publish
uses: ./amplify-js/.github/actions/npm-publish
with:
target: ${{ inputs.target }}
npm_token: ${{ secrets.NPM_TOKEN }}
github_user: ${{ vars.GH_USER}}
github_email: ${{ vars.GH_EMAIL}}

- name: Set github commit user
env:
GITHUB_EMAIL: ${{ vars.GH_EMAIL }}
GITHUB_USER: ${{ vars.GH_USER }}
run: |
git config --global user.email $GITHUB_EMAIL
git config --global user.name $GITHUB_USER
- name: Update API documentation
working-directory: ./amplify-js
run: |
yarn run docs
git add ./docs/api/
git commit -m "chore(release): update API docs [ci skip]"
- name: Push post release changes
working-directory: ./amplify-js
env:
TARGET_BRANCH: ${{ inputs.target }}
run: |
git push origin $TARGET_BRANCH
2 changes: 1 addition & 1 deletion .github/workflows/callable-npm-publish-preid.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
ALLOW_PROTECTED_PREIDS: ${{ inputs.allow-protected-preid }}
PREID: ${{ inputs.preid }}
FORBIDDEN_PREIDS: latest
PROTECTED_PREIDS: next unstable
PROTECTED_PREIDS: next unstable stable-5 stable-4
run: |
echo "Testing to see if $PREID is in the forbidden list ($FORBIDDEN_PREIDS)"
for e in $FORBIDDEN_PREIDS; do [[ $PREID == $e ]] && echo "$PREID is forbidden from preid release" && exit 1; done
Expand Down
25 changes: 25 additions & 0 deletions .github/workflows/push-lts-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: Push - release from LTS branch to LTS dist tag

concurrency:
# group name unique for push to push-latest-release
group: push-lts-release-${{ github.ref }}
cancel-in-progress: true

on:
push:
branches:
- v5-stable

jobs:
e2e:
secrets: inherit
uses: ./.github/workflows/callable-release-verification.yml
release:
needs:
- e2e
permissions:
contents: write
secrets: inherit
uses: ./.github/workflows/callable-npm-publish-lts-release.yml
with:
target: v5-stable # TODO Update this to support other LTS branches in the future
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
"publish:main": "lerna publish --canary --force-publish \"*\" --yes --dist-tag=unstable --preid=unstable${PREID_HASH_SUFFIX} --exact --no-verify-access",
"publish:next": "lerna publish --canary --force-publish \"*\" --yes --dist-tag=next --preid=next${PREID_HASH_SUFFIX} --exact --no-verify-access",
"publish:release": "lerna publish --conventional-commits --yes --message 'chore(release): Publish [ci skip]' --no-verify-access",
"publish:v5-stable": "lerna publish --conventional-commits --yes --dist-tag=stable-5 --message 'chore(release): Publish [ci skip]' --no-verify-access",
"publish:verdaccio": "lerna publish --no-push --canary minor --dist-tag=unstable --preid=unstable --exact --force-publish --yes --no-verify-access",
"ts-coverage": "lerna run ts-coverage"
},
Expand Down
32 changes: 15 additions & 17 deletions packages/api-graphql/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,10 @@
"test": "npm run lint && jest --coverage",
"test:size": "size-limit",
"build-with-test": "npm test && npm run build",
"build:cjs": "node ./build es5 && webpack && webpack --config ./webpack.config.dev.js",
"build:esm": "node ./build es6",
"build:cjs:watch": "node ./build es5 --watch",
"build:esm:watch": "node ./build es6 --watch",
"build:cjs": "rimraf lib && tsc -m commonjs --outDir lib && webpack && webpack --config ./webpack.config.dev.js",
"build:esm": "rimraf lib-esm && tsc -m esnext --outDir lib-esm",
"build:cjs:watch": "rimraf lib && tsc -m commonjs --outDir lib --watch",
"build:esm:watch": "rimraf lib-esm && tsc -m esnext --outDir lib-esm --watch",
"build": "npm run clean && npm run build:esm && npm run build:cjs",
"clean": "npm run clean:size && rimraf lib-esm lib dist",
"clean:size": "rimraf dual-publish-tmp tmp*",
Expand All @@ -41,7 +41,8 @@
},
"homepage": "https://aws-amplify.github.io/",
"devDependencies": {
"@types/zen-observable": "^0.8.0"
"@types/zen-observable": "^0.8.0",
"typescript": "5.0.2"
},
"files": [
"lib",
Expand All @@ -65,29 +66,26 @@
"name": "API (GraphQL client)",
"path": "./lib-esm/index.js",
"import": "{ Amplify, GraphQLAPI }",
"limit": "89.52 kB"
"limit": "95273 B"
}
],
"jest": {
"moduleNameMapper": {
"axios": "axios/dist/node/axios.cjs"
},
"globals": {
"ts-jest": {
"diagnostics": false,
"tsConfig": {
"lib": [
"es5",
"es2015",
"dom",
"esnext.asynciterable",
"es2017.object"
],
"allowJs": true
}
"tsConfig": false
}
},
"transform": {
"^.+\\.(js|jsx|ts|tsx)$": "ts-jest"
},
"testRegex": "(/__tests__/.*|\\.(test|spec))\\.(tsx?|jsx?)$",
"testPathIgnorePatterns": [
"/testUtils/"
],
"moduleFileExtensions": [
"ts",
"tsx",
Expand All @@ -96,7 +94,6 @@
"jsx"
],
"testEnvironment": "jsdom",
"testURL": "http://localhost/",
"coverageThreshold": {
"global": {
"branches": 0,
Expand All @@ -105,6 +102,7 @@
"statements": 0
}
},
"testURL": "http://localhost/",
"coveragePathIgnorePatterns": [
"/node_modules/",
"dist",
Expand Down
8 changes: 8 additions & 0 deletions packages/api-graphql/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"extends": "../tsconfig.base.json",
"compilerOptions": {},
"include": ["./src"],
"watchOptions": {
"excludeDirectories": ["lib*"]
}
}
96 changes: 48 additions & 48 deletions packages/api-rest/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,10 @@
"test": "npm run lint && jest --coverage",
"test:size": "size-limit",
"build-with-test": "npm test && npm run build",
"build:cjs": "node ./build es5 && webpack && webpack --config ./webpack.config.dev.js",
"build:esm": "node ./build es6",
"build:cjs:watch": "node ./build es5 --watch",
"build:esm:watch": "node ./build es6 --watch",
"build:cjs": "rimraf lib && tsc -m commonjs --outDir lib && webpack && webpack --config ./webpack.config.dev.js",
"build:esm": "rimraf lib-esm && tsc -m esnext --outDir lib-esm",
"build:cjs:watch": "rimraf lib && tsc -m commonjs --outDir lib --watch",
"build:esm:watch": "rimraf lib-esm && tsc -m esnext --outDir lib-esm --watch",
"build": "npm run clean && npm run build:esm && npm run build:cjs",
"clean": "npm run clean:size && rimraf lib-esm lib dist",
"clean:size": "rimraf dual-publish-tmp tmp*",
Expand All @@ -47,60 +47,60 @@
],
"dependencies": {
"@aws-amplify/core": "5.8.5",
"axios": "0.26.0",
"axios": "1.6.0",
"tslib": "^1.8.0",
"url": "0.11.0"
},
"devDependencies": {
"typescript": "5.0.2"
},
"size-limit": [
{
"name": "API (rest client)",
"path": "./lib-esm/index.js",
"import": "{ Amplify, RestAPI }",
"limit": "31.3 kB"
"limit": "36.68 kB"
}
],
"jest": {
"globals": {
"ts-jest": {
"diagnostics": false,
"tsConfig": {
"lib": [
"es5",
"es2015",
"dom",
"esnext.asynciterable",
"es2017.object"
],
"allowJs": true
}
}
},
"transform": {
"^.+\\.(js|jsx|ts|tsx)$": "ts-jest"
"moduleNameMapper": {
"axios": "axios/dist/node/axios.cjs"
},
"testRegex": "(/__tests__/.*|\\.(test|spec))\\.(tsx?|jsx?)$",
"moduleFileExtensions": [
"ts",
"tsx",
"js",
"json",
"jsx"
],
"testEnvironment": "jsdom",
"testURL": "http://localhost/",
"coverageThreshold": {
"global": {
"branches": 0,
"functions": 0,
"lines": 0,
"statements": 0
}
},
"coveragePathIgnorePatterns": [
"/node_modules/",
"dist",
"lib",
"lib-esm"
]
}
"globals": {
"ts-jest": {
"diagnostics": false,
"tsConfig": false
}
},
"transform": {
"^.+\\.(js|jsx|ts|tsx)$": "ts-jest"
},
"testRegex": "(/__tests__/.*|\\.(test|spec))\\.(tsx?|jsx?)$",
"testPathIgnorePatterns": [
"/testUtils/"
],
"moduleFileExtensions": [
"ts",
"tsx",
"js",
"json",
"jsx"
],
"testEnvironment": "jsdom",
"coverageThreshold": {
"global": {
"branches": 0,
"functions": 0,
"lines": 0,
"statements": 0
}
},
"testURL": "http://localhost/",
"coveragePathIgnorePatterns": [
"/node_modules/",
"dist",
"lib",
"lib-esm"
]
}
}
8 changes: 8 additions & 0 deletions packages/api-rest/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"extends": "../tsconfig.base.json",
"compilerOptions": {},
"include": ["./src"],
"watchOptions": {
"excludeDirectories": ["lib*"]
}
}
Loading

0 comments on commit 38904db

Please sign in to comment.