@ada-support/web-storage 0.0.3 → 0.0.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
name: "Notify people"
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
pull_request:
|
|
5
|
+
types: [ready_for_review]
|
|
6
|
+
jobs:
|
|
7
|
+
notify:
|
|
8
|
+
runs-on: ubuntu-latest
|
|
9
|
+
steps:
|
|
10
|
+
- name: Slack Notification
|
|
11
|
+
uses: rtCamp/action-slack-notify@v2
|
|
12
|
+
env:
|
|
13
|
+
SLACK_USERNAME: "`@ada-support/web-storage` package updates"
|
|
14
|
+
SLACK_ICON_EMOJI: ":sparkles:"
|
|
15
|
+
SLACK_CHANNEL: "chatx"
|
|
16
|
+
SLACK_COLOR: "#f5e512"
|
|
17
|
+
SLACK_TITLE: "Changes to `web-storage` are ready for review"
|
|
18
|
+
SLACK_MESSAGE: "Pull request: ${{ github.server_url }}/${{ github.repository }}/pull/${{ github.event.number }}"
|
|
19
|
+
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK_URL }}
|
|
20
|
+
MSG_MINIMAL: true
|
|
@@ -13,16 +13,22 @@ jobs:
|
|
|
13
13
|
GITHUB_TOKEN: ${{ secrets.PUSH_ACCESS_TOKEN }}
|
|
14
14
|
with:
|
|
15
15
|
ref: ${{ github.ref }}
|
|
16
|
+
fetch-depth: 0 # We need this to be able to run `diff` with `main` branch
|
|
16
17
|
|
|
17
18
|
- uses: actions/setup-node@v3
|
|
18
19
|
with:
|
|
19
20
|
node-version: "16"
|
|
20
21
|
registry-url: "https://registry.npmjs.org"
|
|
21
|
-
cache:
|
|
22
|
+
cache: "npm"
|
|
22
23
|
|
|
23
|
-
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
24
|
+
- name: "Yarn install"
|
|
25
|
+
run: yarn install
|
|
26
|
+
|
|
27
|
+
- name: "Check package version"
|
|
28
|
+
run: yarn check-package-version
|
|
29
|
+
|
|
30
|
+
- name: "Lint"
|
|
31
|
+
run: yarn lint
|
|
32
|
+
|
|
33
|
+
- name: "Compile"
|
|
34
|
+
run: yarn compile
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
#!/bin/sh
|
|
2
|
+
|
|
3
|
+
NEW_VERSION=$(< package.json grep version \
|
|
4
|
+
| head -1 \
|
|
5
|
+
| awk -F: '{ print $2 }' \
|
|
6
|
+
| sed 's/[", ]//g')
|
|
7
|
+
|
|
8
|
+
# if the package version was changed locally, there should be a diff with the main branch
|
|
9
|
+
VERSION_ON_MAIN=$(git diff origin/main package.json \
|
|
10
|
+
| grep version \
|
|
11
|
+
| head -1 \
|
|
12
|
+
| awk -F: '{ print $2 }' \
|
|
13
|
+
| sed 's/[", ]//g')
|
|
14
|
+
|
|
15
|
+
curl https://raw.githubusercontent.com/Ariel-Rodriguez/sh-semversion-2/main/semver2.sh -o semver2.sh --silent
|
|
16
|
+
|
|
17
|
+
# if there is no version diff with the main branch, then it hasn't been changed so exit
|
|
18
|
+
if [ -z $VERSION_ON_MAIN ]
|
|
19
|
+
then
|
|
20
|
+
echo "Package version must be updated"
|
|
21
|
+
exit 1
|
|
22
|
+
fi
|
|
23
|
+
|
|
24
|
+
RESULT=$(sh ./semver2.sh "$NEW_VERSION" "$VERSION_ON_MAIN")
|
|
25
|
+
|
|
26
|
+
if [ "$RESULT" -lt 1 ]
|
|
27
|
+
then
|
|
28
|
+
echo "Package version must be updated"
|
|
29
|
+
exit 1
|
|
30
|
+
fi
|
package/dist/storage-keys.d.ts
CHANGED
|
@@ -2,13 +2,8 @@ export interface AdaFunctionalStorageValue {
|
|
|
2
2
|
rolloutGroup: {
|
|
3
3
|
[clientHandle: string]: "A" | "B";
|
|
4
4
|
};
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
[clientHandle: string]: "A" | "B";
|
|
8
|
-
};
|
|
9
|
-
lastProbability: {
|
|
10
|
-
[clientHandle: string]: number;
|
|
11
|
-
};
|
|
5
|
+
rolloutLastValue: {
|
|
6
|
+
[clientHandle: string]: number;
|
|
12
7
|
};
|
|
13
8
|
}
|
|
14
9
|
export interface StorageValueByKey {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ada-support/web-storage",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.5",
|
|
4
4
|
"description": "A package to provide access to Web Storage API",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"publishConfig": {
|
|
@@ -8,6 +8,7 @@
|
|
|
8
8
|
},
|
|
9
9
|
"scripts": {
|
|
10
10
|
"lint": "tsc --noEmit && npx eslint --ext .ts .",
|
|
11
|
+
"check-package-version": "./ci-tools/check-package-version.sh",
|
|
11
12
|
"compile": "rm -rf dist && npx tsc"
|
|
12
13
|
},
|
|
13
14
|
"repository": {
|
package/src/storage-keys.ts
CHANGED
|
@@ -2,13 +2,8 @@ export interface AdaFunctionalStorageValue {
|
|
|
2
2
|
rolloutGroup: {
|
|
3
3
|
[clientHandle: string]: "A" | "B";
|
|
4
4
|
};
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
[clientHandle: string]: "A" | "B";
|
|
8
|
-
};
|
|
9
|
-
lastProbability: {
|
|
10
|
-
[clientHandle: string]: number;
|
|
11
|
-
};
|
|
5
|
+
rolloutLastValue: {
|
|
6
|
+
[clientHandle: string]: number;
|
|
12
7
|
};
|
|
13
8
|
}
|
|
14
9
|
|