@formo/analytics 1.17.2 → 1.17.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.
- package/package.json +4 -1
- package/.env.example +0 -1
- package/.github/workflows/ci.yml +0 -50
- package/.github/workflows/release.yml +0 -54
- package/.husky/post-commit +0 -7
- package/.husky/pre-commit +0 -11
- package/.releaserc.js +0 -34
- package/CONTRIBUTING.md +0 -83
- package/scripts/generate-sri.sh +0 -52
- package/src/FormoAnalytics.ts +0 -1031
- package/src/FormoAnalyticsProvider.tsx +0 -84
- package/src/constants/base.ts +0 -6
- package/src/constants/config.ts +0 -660
- package/src/constants/events.ts +0 -21
- package/src/constants/index.ts +0 -3
- package/src/global.d.ts +0 -12
- package/src/index.ts +0 -3
- package/src/lib/event/EventFactory.ts +0 -519
- package/src/lib/event/EventManager.ts +0 -39
- package/src/lib/event/constants.ts +0 -4
- package/src/lib/event/index.ts +0 -3
- package/src/lib/event/type.ts +0 -9
- package/src/lib/event/utils.ts +0 -33
- package/src/lib/fetch.ts +0 -3
- package/src/lib/index.ts +0 -5
- package/src/lib/logger/Logger.ts +0 -115
- package/src/lib/logger/index.ts +0 -2
- package/src/lib/logger/type.ts +0 -14
- package/src/lib/queue/EventQueue.ts +0 -306
- package/src/lib/queue/index.ts +0 -2
- package/src/lib/queue/type.ts +0 -6
- package/src/lib/ramda/internal/_curry1.ts +0 -19
- package/src/lib/ramda/internal/_curry2.ts +0 -37
- package/src/lib/ramda/internal/_curry3.ts +0 -68
- package/src/lib/ramda/internal/_has.ts +0 -3
- package/src/lib/ramda/internal/_isObject.ts +0 -3
- package/src/lib/ramda/internal/_isPlaceholder.ts +0 -5
- package/src/lib/ramda/mergeDeepRight.ts +0 -13
- package/src/lib/ramda/mergeDeepWithKey.ts +0 -22
- package/src/lib/ramda/mergeWithKey.ts +0 -28
- package/src/lib/storage/StorageManager.ts +0 -51
- package/src/lib/storage/built-in/blueprint.ts +0 -17
- package/src/lib/storage/built-in/cookie.ts +0 -60
- package/src/lib/storage/built-in/memory.ts +0 -23
- package/src/lib/storage/built-in/web.ts +0 -57
- package/src/lib/storage/constant.ts +0 -2
- package/src/lib/storage/index.ts +0 -25
- package/src/lib/storage/type.ts +0 -21
- package/src/lib/version.ts +0 -2
- package/src/types/base.ts +0 -120
- package/src/types/events.ts +0 -126
- package/src/types/index.ts +0 -3
- package/src/types/provider.ts +0 -17
- package/src/utils/address.ts +0 -43
- package/src/utils/base.ts +0 -3
- package/src/utils/converter.ts +0 -44
- package/src/utils/generate.ts +0 -16
- package/src/utils/index.ts +0 -4
- package/src/utils/timestamp.ts +0 -9
- package/src/validators/address.ts +0 -69
- package/src/validators/agent.ts +0 -4
- package/src/validators/checks.ts +0 -160
- package/src/validators/index.ts +0 -7
- package/src/validators/network.ts +0 -34
- package/src/validators/object.ts +0 -4
- package/src/validators/string.ts +0 -4
- package/src/validators/uint8array.ts +0 -17
- package/test/lib/events.spec.ts +0 -12
- package/test/utils/address.spec.ts +0 -14
- package/test/utils/converter.spec.ts +0 -31
- package/test/validators/address.spec.ts +0 -15
- package/tsconfig.json +0 -28
- 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
|
+
"version": "1.17.4",
|
|
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 =
|
package/.github/workflows/ci.yml
DELETED
|
@@ -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 }}
|
package/.husky/post-commit
DELETED
package/.husky/pre-commit
DELETED
package/.releaserc.js
DELETED
|
@@ -1,34 +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
|
-
assets: ["dist"],
|
|
24
|
-
addReleases: "bottom",
|
|
25
|
-
},
|
|
26
|
-
],
|
|
27
|
-
[
|
|
28
|
-
"@semantic-release/exec",
|
|
29
|
-
{
|
|
30
|
-
successCmd: "scripts/generate-sri.sh ${nextRelease.version}",
|
|
31
|
-
},
|
|
32
|
-
],
|
|
33
|
-
],
|
|
34
|
-
};
|
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) |
|
package/scripts/generate-sri.sh
DELETED
|
@@ -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."
|