@thalalabs/surf 0.0.1 → 0.0.3

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,15 @@
1
+ # How to upgrade the version
2
+
3
+ - Run `yarn changesets`, and describe you change.
4
+ - Commit the `.md` file generated by `changeset` together with your code changes. And merge your change.
5
+ - Github Workflow will create a PR to change the version in `package.json`.
6
+ - Github Workflow will publish a new version to NPM after we merge the PR.
7
+
8
+ # Changesets
9
+
10
+ Hello and welcome! This folder has been automatically generated by `@changesets/cli`, a build tool that works
11
+ with multi-package repos, or single-package repos to help you version and publish your code. You can
12
+ find the full documentation for it [in our repository](https://github.com/changesets/changesets)
13
+
14
+ We have a quick list of common questions to get you started engaging with this project in
15
+ [our documentation](https://github.com/changesets/changesets/blob/main/docs/common-questions.md)
@@ -0,0 +1,11 @@
1
+ {
2
+ "$schema": "https://unpkg.com/@changesets/config@2.3.0/schema.json",
3
+ "changelog": "@changesets/cli/changelog",
4
+ "commit": false,
5
+ "fixed": [],
6
+ "linked": [],
7
+ "access": "public",
8
+ "baseBranch": "main",
9
+ "updateInternalDependencies": "patch",
10
+ "ignore": []
11
+ }
@@ -0,0 +1,31 @@
1
+ name: Publish
2
+ on:
3
+ workflow_run:
4
+ workflows: ["CI"]
5
+ types:
6
+ - completed
7
+ push:
8
+ branches:
9
+ - "main"
10
+
11
+ concurrency: ${{ github.workflow }}-${{ github.ref }}
12
+
13
+ jobs:
14
+ publish:
15
+ runs-on: ubuntu-latest
16
+
17
+ steps:
18
+ - uses: actions/checkout@v2
19
+ - uses: actions/setup-node@v3
20
+ with:
21
+ node-version: 16.x
22
+ - run: yarn install --frozen-lockfile
23
+ - run: yarn test
24
+ - name: Create Release Pull Request or Publish
25
+ id: changesets
26
+ uses: changesets/action@v1
27
+ with:
28
+ publish: yarn release
29
+ env:
30
+ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
31
+ NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
package/CHANGELOG.md ADDED
@@ -0,0 +1,7 @@
1
+ # @thalalabs/surf
2
+
3
+ ## 0.0.3
4
+
5
+ ### Patch Changes
6
+
7
+ - 5d3395d: Add changeset as devDependency and use it to manage the versioning and releasing.
package/README.md CHANGED
@@ -9,29 +9,14 @@
9
9
  <p>
10
10
 
11
11
  <p align="center">
12
- <a href="https://www.npmjs.com/package/viem">
13
- <picture>
14
- <source media="(prefers-color-scheme: dark)" srcset="https://img.shields.io/npm/v/viem?colorA=21262d&colorB=21262d&style=flat">
15
- <img src="https://img.shields.io/npm/v/viem?colorA=f6f8fa&colorB=f6f8fa&style=flat" alt="Version">
16
- </picture>
17
- </a>
18
- <a href="https://app.codecov.io/gh/wagmi-dev/viem">
19
- <picture>
20
- <source media="(prefers-color-scheme: dark)" srcset="https://img.shields.io/codecov/c/github/wagmi-dev/viem?colorA=21262d&colorB=21262d&style=flat">
21
- <img src="https://img.shields.io/codecov/c/github/wagmi-dev/viem?colorA=f6f8fa&colorB=f6f8fa&style=flat" alt="Code coverage">
22
- </picture>
12
+ <a href="https://www.npmjs.com/package/@thalalabs/surf">
13
+ <img src="https://img.shields.io/npm/v/@thalalabs/surf?colorA=2c8af7&colorB=2c8af7&style=flat" alt="Version">
23
14
  </a>
24
15
  <a href="https://github.com/ThalaLabs/surf/blob/main/LICENSE">
25
- <picture>
26
- <source media="(prefers-color-scheme: dark)" srcset="https://img.shields.io/npm/l/viem?colorA=21262d&colorB=21262d&style=flat">
27
- <img src="https://img.shields.io/npm/l/viem?colorA=f6f8fa&colorB=f6f8fa&style=flat" alt="MIT License">
28
- </picture>
16
+ <img src="https://img.shields.io/npm/l/@thalalabs/surf?colorA=2c8af7&colorB=2c8af7&style=flat" alt="MIT License">
29
17
  </a>
30
- <a href="https://bestofjs.org/projects/viem">
31
- <picture>
32
- <source media="(prefers-color-scheme: dark)" srcset="https://img.shields.io/endpoint?colorA=21262d&colorB=21262d&style=flat&url=https://bestofjs-serverless.now.sh/api/project-badge?fullName=wagmi-dev%2Fviem%26since=daily">
33
- <img src="https://img.shields.io/endpoint?colorA=f6f8fa&colorB=f6f8fa&style=flat&url=https://bestofjs-serverless.now.sh/api/project-badge?fullName=wagmi-dev%2Fviem%26since=daily" alt="Best of JS">
34
- </picture>
18
+ <a href="https://bundlephobia.com/package/@thalalabs/surf">
19
+ <img src="https://img.shields.io/bundlephobia/minzip/@thalalabs/surf?colorA=2c8af7&colorB=2c8af7&style=flat" alt="MIT License">
35
20
  </a>
36
21
  </p>
37
22
 
@@ -39,11 +24,11 @@
39
24
 
40
25
  ## Features
41
26
 
42
- - **No code-generation**: Interact with smart contracts using fully typed APIs based on static type inference.
27
+ - **No code-generation**: Interact with smart contracts using fully typed APIs based on static type inference. Inspired by [Viem](https://viem.sh/).
43
28
  - **Get rid of encoding/decoding**: Surf takes care of the complexities within the APIs, so you don't have to.
44
29
  - **Linting and Auto-Completion**: Enjoy a better development experience with type safety. No more guesswork for input and output.
45
30
  - **Both TypeScript Interfaces & React Hooks**: Easy to use, whether working with wallets or private keys.
46
- - **Low runtime cost & small bundle size**: Modular, tree-shakable, [100kb]().
31
+ - **Low runtime cost & small bundle size**: [minzipped size: 1.77 kB](https://bundlephobia.com/package/@thalalabs/surf).
47
32
 
48
33
  ## Overview
49
34
 
@@ -179,9 +164,9 @@ const { hash } = await client.simulateTransaction(
179
164
  );
180
165
  ```
181
166
 
182
- ### Hooks
167
+ ### React Hooks
183
168
 
184
- Surf currently offers two React Hooks: `useWalletClient` and `useSubmitTransaction`. Both require the `@aptos-labs/wallet-adapter-react`. Check out our [example NextJS package](https://github.com/ThalaLabs/surf/blob/main/example/app/page.tsx) for more information.
169
+ Surf currently offers two React Hooks: `useWalletClient` and `useSubmitTransaction`. Both require the `@aptos-labs/wallet-adapter-react`. Check out the [example NextJS package](https://github.com/ThalaLabs/surf/blob/main/example/app/page.tsx) for more information.
185
170
 
186
171
  ## Motivation
187
172
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@thalalabs/surf",
3
- "version": "0.0.1",
3
+ "version": "0.0.3",
4
4
  "description": "TypeScript Interfaces & React Hooks for interacting with Aptos Smart Contracts with type safety.",
5
5
  "main": "./build/cjs/index.js",
6
6
  "module": "./build/esm/index.js",
@@ -25,11 +25,14 @@
25
25
  },
26
26
  "typesVersions": {
27
27
  "*": {
28
- "hooks": ["./build/types/hooks/index.d.ts"]
28
+ "hooks": [
29
+ "./build/types/hooks/index.d.ts"
30
+ ]
29
31
  }
30
32
  },
31
33
  "devDependencies": {
32
34
  "@aptos-labs/wallet-adapter-react": "^1.1.0",
35
+ "@changesets/cli": "^2.26.1",
33
36
  "@types/jest": "~29.5",
34
37
  "@types/node": "~18",
35
38
  "@types/react": "^18.2.8",
@@ -49,10 +52,18 @@
49
52
  "typescript": "~5.0"
50
53
  },
51
54
  "peerDependencies": {
52
- "@aptos-labs/wallet-adapter-react": "^1.1.0",
53
- "aptos": "^1.9.0",
55
+ "@aptos-labs/wallet-adapter-react": "^1.0.0",
56
+ "aptos": "^1.6.0",
54
57
  "react": "^18.2.0"
55
58
  },
59
+ "peerDependenciesMeta": {
60
+ "@aptos-labs/wallet-adapter-react": {
61
+ "optional": true
62
+ },
63
+ "react": {
64
+ "optional": true
65
+ }
66
+ },
56
67
  "scripts": {
57
68
  "start": "node build/src/main.js",
58
69
  "clean": "rimraf coverage build tmp",
@@ -66,13 +77,17 @@
66
77
  "test": "jest --coverage",
67
78
  "prettier": "prettier --config .prettierrc --write .",
68
79
  "test:watch": "jest --watch",
69
- "prepublishOnly": "yarn build"
80
+ "release": "yarn build && changeset publish"
70
81
  },
71
82
  "keywords": [
72
83
  "move",
73
84
  "blockchain",
74
85
  "aptos"
75
86
  ],
87
+ "repository": {
88
+ "type": "git",
89
+ "url": "git+https://github.com/ThalaLabs/surf"
90
+ },
76
91
  "license": "MIT",
77
92
  "dependencies": {}
78
- }
93
+ }