@ada-support/web-storage 0.0.3 → 0.0.4

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.
@@ -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: 'npm'
22
+ cache: "npm"
22
23
 
23
- - run: |
24
- yarn install
25
- yarn compile
26
- yarn lint
27
- env:
28
- NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
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
@@ -2,13 +2,8 @@ export interface AdaFunctionalStorageValue {
2
2
  rolloutGroup: {
3
3
  [clientHandle: string]: "A" | "B";
4
4
  };
5
- rollout: {
6
- group: {
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",
3
+ "version": "0.0.4",
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": {
@@ -2,13 +2,8 @@ export interface AdaFunctionalStorageValue {
2
2
  rolloutGroup: {
3
3
  [clientHandle: string]: "A" | "B";
4
4
  };
5
- rollout: {
6
- group: {
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