@formo/analytics 1.17.3 → 1.17.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.
Files changed (73) hide show
  1. package/package.json +4 -1
  2. package/.env.example +0 -1
  3. package/.github/workflows/ci.yml +0 -50
  4. package/.github/workflows/release.yml +0 -54
  5. package/.husky/post-commit +0 -7
  6. package/.husky/pre-commit +0 -11
  7. package/.releaserc.js +0 -35
  8. package/CONTRIBUTING.md +0 -83
  9. package/scripts/generate-sri.sh +0 -52
  10. package/src/FormoAnalytics.ts +0 -1031
  11. package/src/FormoAnalyticsProvider.tsx +0 -84
  12. package/src/constants/base.ts +0 -6
  13. package/src/constants/config.ts +0 -660
  14. package/src/constants/events.ts +0 -21
  15. package/src/constants/index.ts +0 -3
  16. package/src/global.d.ts +0 -12
  17. package/src/index.ts +0 -3
  18. package/src/lib/event/EventFactory.ts +0 -519
  19. package/src/lib/event/EventManager.ts +0 -39
  20. package/src/lib/event/constants.ts +0 -4
  21. package/src/lib/event/index.ts +0 -3
  22. package/src/lib/event/type.ts +0 -9
  23. package/src/lib/event/utils.ts +0 -33
  24. package/src/lib/fetch.ts +0 -3
  25. package/src/lib/index.ts +0 -5
  26. package/src/lib/logger/Logger.ts +0 -115
  27. package/src/lib/logger/index.ts +0 -2
  28. package/src/lib/logger/type.ts +0 -14
  29. package/src/lib/queue/EventQueue.ts +0 -306
  30. package/src/lib/queue/index.ts +0 -2
  31. package/src/lib/queue/type.ts +0 -6
  32. package/src/lib/ramda/internal/_curry1.ts +0 -19
  33. package/src/lib/ramda/internal/_curry2.ts +0 -37
  34. package/src/lib/ramda/internal/_curry3.ts +0 -68
  35. package/src/lib/ramda/internal/_has.ts +0 -3
  36. package/src/lib/ramda/internal/_isObject.ts +0 -3
  37. package/src/lib/ramda/internal/_isPlaceholder.ts +0 -5
  38. package/src/lib/ramda/mergeDeepRight.ts +0 -13
  39. package/src/lib/ramda/mergeDeepWithKey.ts +0 -22
  40. package/src/lib/ramda/mergeWithKey.ts +0 -28
  41. package/src/lib/storage/StorageManager.ts +0 -51
  42. package/src/lib/storage/built-in/blueprint.ts +0 -17
  43. package/src/lib/storage/built-in/cookie.ts +0 -60
  44. package/src/lib/storage/built-in/memory.ts +0 -23
  45. package/src/lib/storage/built-in/web.ts +0 -57
  46. package/src/lib/storage/constant.ts +0 -2
  47. package/src/lib/storage/index.ts +0 -25
  48. package/src/lib/storage/type.ts +0 -21
  49. package/src/lib/version.ts +0 -2
  50. package/src/types/base.ts +0 -120
  51. package/src/types/events.ts +0 -126
  52. package/src/types/index.ts +0 -3
  53. package/src/types/provider.ts +0 -17
  54. package/src/utils/address.ts +0 -43
  55. package/src/utils/base.ts +0 -3
  56. package/src/utils/converter.ts +0 -44
  57. package/src/utils/generate.ts +0 -16
  58. package/src/utils/index.ts +0 -4
  59. package/src/utils/timestamp.ts +0 -9
  60. package/src/validators/address.ts +0 -69
  61. package/src/validators/agent.ts +0 -4
  62. package/src/validators/checks.ts +0 -160
  63. package/src/validators/index.ts +0 -7
  64. package/src/validators/network.ts +0 -34
  65. package/src/validators/object.ts +0 -4
  66. package/src/validators/string.ts +0 -4
  67. package/src/validators/uint8array.ts +0 -17
  68. package/test/lib/events.spec.ts +0 -12
  69. package/test/utils/address.spec.ts +0 -14
  70. package/test/utils/converter.spec.ts +0 -31
  71. package/test/validators/address.spec.ts +0 -15
  72. package/tsconfig.json +0 -28
  73. package/webpack.config.ts +0 -23
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@formo/analytics",
3
- "version": "1.17.3",
3
+ "version": "1.17.5",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "git+https://github.com/getformo/sdk.git"
@@ -9,6 +9,9 @@
9
9
  "types": "dist/esm/src/index.d.ts",
10
10
  "module": "dist/esm/src/index.js",
11
11
  "unpkg": "dist/index.umd.min.js",
12
+ "files": [
13
+ "dist"
14
+ ],
12
15
  "exports": {
13
16
  ".": {
14
17
  "import": "./dist/esm/src/index.js",
package/.env.example DELETED
@@ -1 +0,0 @@
1
- REACT_APP_HIGHLIGHT_PROJECT_ID =
@@ -1,50 +0,0 @@
1
- name: Formo SDK CI Check
2
-
3
- on:
4
- push:
5
- branches-ignore: [main]
6
- pull_request:
7
- branches:
8
- - main
9
-
10
- permissions:
11
- contents: read
12
- pages: write
13
- id-token: write
14
-
15
- concurrency:
16
- group: "pages"
17
- cancel-in-progress: false
18
-
19
- jobs:
20
- build:
21
- runs-on: ubuntu-latest
22
- steps:
23
- - name: Checkout
24
- uses: actions/checkout@v4
25
- - name: Detect package manager
26
- id: detect-package-manager
27
- run: |
28
- if [ -f "${{ github.workspace }}/yarn.lock" ]; then
29
- echo "manager=yarn" >> $GITHUB_OUTPUT
30
- echo "command=install" >> $GITHUB_OUTPUT
31
- echo "runner=yarn" >> $GITHUB_OUTPUT
32
- exit 0
33
- elif [ -f "${{ github.workspace }}/package.json" ]; then
34
- echo "manager=npm" >> $GITHUB_OUTPUT
35
- echo "command=ci" >> $GITHUB_OUTPUT
36
- echo "runner=npx --no-install" >> $GITHUB_OUTPUT
37
- exit 0
38
- else
39
- echo "Unable to determine package manager"
40
- exit 1
41
- fi
42
- - name: Setup Node
43
- uses: actions/setup-node@v4
44
- with:
45
- node-version: "20"
46
- cache: ${{ steps.detect-package-manager.outputs.manager }}
47
- - name: Install dependencies
48
- run: ${{ steps.detect-package-manager.outputs.manager }} ${{ steps.detect-package-manager.outputs.command }}
49
- - name: Build SDK
50
- run: ${{ steps.detect-package-manager.outputs.runner }} build
@@ -1,54 +0,0 @@
1
- name: Release package
2
-
3
- # Runs when a PR to main is merged, main branch is protected, so that only PRs to main are merged
4
- on:
5
- push:
6
- branches:
7
- - main
8
-
9
- jobs:
10
- release:
11
- permissions:
12
- contents: write
13
- issues: write
14
- pull-requests: write
15
- id-token: write
16
-
17
- runs-on: ubuntu-latest
18
- steps:
19
- - name: Checkout
20
- uses: actions/checkout@v4
21
- - name: Detect package manager
22
- id: detect-package-manager
23
- run: |
24
- if [ -f "${{ github.workspace }}/yarn.lock" ]; then
25
- echo "manager=yarn" >> $GITHUB_OUTPUT
26
- echo "command=install" >> $GITHUB_OUTPUT
27
- echo "build_command=build" >> $GITHUB_OUTPUT
28
- echo "runner=yarn" >> $GITHUB_OUTPUT
29
- exit 0
30
- elif [ -f "${{ github.workspace }}/package.json" ]; then
31
- echo "manager=npm" >> $GITHUB_OUTPUT
32
- echo "command=ci" >> $GITHUB_OUTPUT
33
- echo "build_command=run build" >> $GITHUB_OUTPUT
34
- echo "runner=npx --no-install" >> $GITHUB_OUTPUT
35
- exit 0
36
- else
37
- echo "Unable to determine package manager"
38
- exit 1
39
- fi
40
- - name: Setup Node
41
- uses: actions/setup-node@v4
42
- with:
43
- node-version: "20"
44
- cache: ${{ steps.detect-package-manager.outputs.manager }}
45
- - name: Install dependencies
46
- run: ${{ steps.detect-package-manager.outputs.manager }} ${{ steps.detect-package-manager.outputs.command }}
47
- - name: Build SDK
48
- run: ${{ steps.detect-package-manager.outputs.manager }} ${{ steps.detect-package-manager.outputs.build_command }}
49
- - name: Release
50
- run: ${{ steps.detect-package-manager.outputs.runner }} semantic-release
51
- env:
52
- GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
53
- GH_RELEASE_TOKEN: ${{ secrets.GH_RELEASE_TOKEN }}
54
- NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
@@ -1,7 +0,0 @@
1
- #!/bin/sh
2
- . "$(dirname "$0")/_/husky.sh"
3
-
4
- echo "✅ Commit completed successfully!"
5
-
6
- # Run size-limit
7
- npx size-limit
package/.husky/pre-commit DELETED
@@ -1,11 +0,0 @@
1
- #!/bin/sh
2
- . "$(dirname "$0")/_/husky.sh"
3
-
4
- echo "Running pre-commit process..."
5
-
6
- npm run build
7
-
8
- npx genversion --esm --semi src/lib/version.ts
9
-
10
- # Add modified files to Git staging
11
- git add .
package/.releaserc.js DELETED
@@ -1,35 +0,0 @@
1
- module.exports = {
2
- branches: ["main"],
3
- plugins: [
4
- [
5
- "@semantic-release/commit-analyzer",
6
- {
7
- preset: "conventionalcommits",
8
- },
9
- ],
10
- "@semantic-release/release-notes-generator",
11
- "@semantic-release/npm",
12
- // Uncomment if you want to commit version bump to package.json
13
- // [
14
- // "@semantic-release/git",
15
- // {
16
- // assets: ["package.json", "package-lock.json"],
17
- // message: "chore(release): ${nextRelease.version} [skip ci]\n\n${nextRelease.notes}",
18
- // },
19
- // ],
20
- [
21
- "@semantic-release/github",
22
- {
23
- addReleases: "bottom",
24
- successComment:
25
- "🎉 This PR is included in version ${nextRelease.version} 🎉 ",
26
- },
27
- ],
28
- [
29
- "@semantic-release/exec",
30
- {
31
- successCmd: "scripts/generate-sri.sh ${nextRelease.version}",
32
- },
33
- ],
34
- ],
35
- };
package/CONTRIBUTING.md DELETED
@@ -1,83 +0,0 @@
1
- # Development Guide
2
-
3
- If you want to contribute or run a local version of the Formo Analytics SDK, follow these steps:
4
-
5
- ### Build the SDK Locally
6
-
7
- Run the following command to build both CommonJS and ESM versions of the SDK:
8
-
9
- ```jsx
10
- yarn build-cjs && yarn build-esm && yarn webpack --mode=production
11
- ```
12
-
13
- or if you're using NPM:
14
-
15
- ```jsx
16
- npm run build
17
- ```
18
-
19
- ### Testing locally
20
-
21
- 1. Link the local package to your project
22
-
23
- > See [this guide](https://dev.to/one-beyond/different-approaches-to-testing-your-own-packages-locally-npm-link-4hoj) on how to use `npm link` or [this guide](https://classic.yarnpkg.com/lang/en/docs/cli/link/) for `yarn link` to test the package locally.
24
-
25
- For example, if I want to test the package with a project that is in the same directory:
26
-
27
- ```
28
- ~/
29
- ├── formo-analytics-example-next/
30
- └── sdk/
31
- ```
32
-
33
- Run the following command:
34
-
35
- ```bash
36
- # ~/formo-analytics-example-next
37
- npm link ../sdk
38
- OR
39
- yarn link ../sdk
40
- ```
41
-
42
- Any changes you make to your local package will be reflected in the project you linked it to.
43
- However, you have to run `build` to apply the changes you made to the local package:
44
-
45
- ```
46
- # ~/sdk
47
- npm run build
48
- ```
49
-
50
- The new change will be reflected in the project you linked it to.
51
-
52
- To unlink the package, run the following command:
53
-
54
- ```bash
55
- # In ~/formo-analytics-example-next
56
- npm unlink ../sdk
57
- OR
58
- yarn unlink ../sdk
59
- ```
60
-
61
- ## Troubleshooting
62
-
63
- - Remove your `node_modules` and `yarn link` and run `yarn link` and `yarn install` again.
64
- - Try running `yarn build` in the SDK directory to ensure the changes are applied.
65
- - Try running `yarn unlink` and `yarn link` again.
66
-
67
- # Commit message format
68
-
69
- **semantic-release** uses the commit messages to determine the consumer impact of changes in the codebase.
70
- Following formalized conventions for commit messages, **semantic-release** automatically determines the next [semantic version](https://semver.org) number, generates a changelog and publishes the release.
71
-
72
- By default, **semantic-release** uses [Angular Commit Message Conventions](https://github.com/angular/angular/blob/main/contributing-docs/commit-message-guidelines.md).
73
- The commit message format can be changed with the [`preset` or `config` options](docs/usage/configuration.md#options) of the [@semantic-release/commit-analyzer](https://github.com/semantic-release/commit-analyzer#options) and [@semantic-release/release-notes-generator](https://github.com/semantic-release/release-notes-generator#options) plugins.
74
-
75
- Tools such as [commitizen](https://github.com/commitizen/cz-cli) or [commitlint](https://github.com/conventional-changelog/commitlint) can be used to help contributors and enforce valid commit messages.
76
-
77
- The table below shows which commit message gets you which release type when `semantic-release` runs (using the default configuration):
78
-
79
- | Commit message | Release type |
80
- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | --------------------------------------------------------------------------------------------------------------- |
81
- | `fix(pencil): stop graphite breaking when too much pressure applied` | ~~Patch~~ Fix Release |
82
- | `feat(pencil): add 'graphiteWidth' option` | ~~Minor~~ Feature Release |
83
- | `perf(pencil): remove graphiteWidth option`<br><br>`BREAKING CHANGE: The graphiteWidth option has been removed.`<br>`The default graphite width of 10mm is always used for performance reasons.` | ~~Major~~ Breaking Release <br /> (Note that the `BREAKING CHANGE: ` token must be in the footer of the commit) |
@@ -1,52 +0,0 @@
1
- #!/bin/bash
2
- set -e
3
-
4
- VERSION=$1
5
- REPO="getformo/sdk"
6
- FILE="dist/index.umd.min.js"
7
- PACKAGE_NAME="@formo/analytics"
8
-
9
- # Get the tarball from unpkg and compute SRI
10
- URL="https://unpkg.com/${PACKAGE_NAME}@${VERSION}/${FILE}"
11
- echo "Fetching: $URL"
12
- HASH=$(curl -sSL --compressed "$URL" | openssl dgst -sha384 -binary | openssl base64 -A)
13
-
14
- SNIPPET=$(cat <<EOF
15
- <script
16
- src="https://unpkg.com/${PACKAGE_NAME}@${VERSION}/${FILE}"
17
- integrity="sha384-${HASH}"
18
- crossorigin="anonymous"
19
- ></script>
20
- EOF
21
- )
22
-
23
- # Get the release ID from GitHub API
24
- RELEASE_ID=$(curl -s -H "Authorization: Bearer $GH_RELEASE_TOKEN" \
25
- https://api.github.com/repos/${REPO}/releases/tags/v${VERSION} \
26
- | jq -r '.id')
27
-
28
- # Fetch current body
29
- CURRENT_BODY=$(curl -s -H "Authorization: Bearer $GH_RELEASE_TOKEN" \
30
- https://api.github.com/repos/${REPO}/releases/$RELEASE_ID \
31
- | jq -r '.body')
32
-
33
- # Append SRI snippet
34
- UPDATED_BODY=$(cat <<EOF
35
- ${CURRENT_BODY}
36
-
37
- 🔒 **Subresource Integrity Snippet**
38
-
39
- \`\`\`html
40
- ${SNIPPET}
41
- \`\`\`
42
- EOF
43
- )
44
-
45
- # Patch the release body
46
- curl -s -X PATCH \
47
- -H "Authorization: Bearer $GH_RELEASE_TOKEN" \
48
- -H "Content-Type: application/json" \
49
- -d "$(jq -n --arg body "$UPDATED_BODY" '{body: $body}')" \
50
- https://api.github.com/repos/${REPO}/releases/$RELEASE_ID
51
-
52
- echo "✅ GitHub Release updated with SRI snippet."