create-near-app 5.3.0 → 5.3.1-beta.1
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 +21 -21
- package/templates/contracts/js/package.json +2 -2
- package/templates/frontend/react/index.js +6 -6
- package/templates/frontend/react/package.json +20 -23
- package/templates/frontend/shared/near-wallet.js +2 -8
- package/templates/frontend/vanilla/index.html +7 -10
- package/templates/frontend/vanilla/package.json +10 -13
- package/templates/shared/rust-toolchain.toml +2 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "create-near-app",
|
|
3
|
-
"version": "5.3.
|
|
3
|
+
"version": "5.3.1-beta.1",
|
|
4
4
|
"description": "Quickly scaffold your dApp on NEAR Blockchain",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"engines": {
|
|
@@ -25,36 +25,36 @@
|
|
|
25
25
|
},
|
|
26
26
|
"dependencies": {
|
|
27
27
|
"chalk": "^4.1.2",
|
|
28
|
-
"commander": "^
|
|
28
|
+
"commander": "^11.0.0",
|
|
29
29
|
"cross-spawn": "^7.0.3",
|
|
30
|
-
"mixpanel": "^0.
|
|
30
|
+
"mixpanel": "^0.17.0",
|
|
31
31
|
"ncp": "^2.0.0",
|
|
32
32
|
"prompts": "^2.4.2",
|
|
33
|
-
"semver": "^7.3
|
|
33
|
+
"semver": "^7.5.3"
|
|
34
34
|
},
|
|
35
35
|
"devDependencies": {
|
|
36
|
-
"@babel/eslint-parser": "^7.
|
|
37
|
-
"@commitlint/cli": "^17.
|
|
38
|
-
"@commitlint/config-conventional": "^17.
|
|
39
|
-
"@release-it/conventional-changelog": "^5.
|
|
36
|
+
"@babel/eslint-parser": "^7.22.5",
|
|
37
|
+
"@commitlint/cli": "^17.6.6",
|
|
38
|
+
"@commitlint/config-conventional": "^17.6.6",
|
|
39
|
+
"@release-it/conventional-changelog": "^5.1.1",
|
|
40
40
|
"@types/cross-spawn": "^6.0.2",
|
|
41
|
-
"@types/jest": "^
|
|
41
|
+
"@types/jest": "^29.5.2",
|
|
42
42
|
"@types/ncp": "^2.0.5",
|
|
43
|
-
"@types/node": "^
|
|
44
|
-
"@types/prompts": "^2.
|
|
45
|
-
"@types/semver": "^7.
|
|
46
|
-
"eslint": "^8.
|
|
43
|
+
"@types/node": "^20.3.2",
|
|
44
|
+
"@types/prompts": "^2.4.4",
|
|
45
|
+
"@types/semver": "^7.5.0",
|
|
46
|
+
"eslint": "^8.43.0",
|
|
47
47
|
"eslint-config-react-app": "^7.0.1",
|
|
48
|
-
"eslint-plugin-import": "^2.
|
|
49
|
-
"eslint-plugin-jsx-a11y": "^6.
|
|
50
|
-
"eslint-plugin-react": "^7.
|
|
48
|
+
"eslint-plugin-import": "^2.27.5",
|
|
49
|
+
"eslint-plugin-jsx-a11y": "^6.7.1",
|
|
50
|
+
"eslint-plugin-react": "^7.32.2",
|
|
51
51
|
"eslint-plugin-react-hooks": "^4.6.0",
|
|
52
|
-
"husky": "^8.0.
|
|
53
|
-
"jest": "^
|
|
52
|
+
"husky": "^8.0.3",
|
|
53
|
+
"jest": "^29.5.0",
|
|
54
54
|
"node-dir": "^0.1.17",
|
|
55
|
-
"release-it": "^15.
|
|
56
|
-
"ts-jest": "^
|
|
57
|
-
"typescript": "^
|
|
55
|
+
"release-it": "^15.11.0",
|
|
56
|
+
"ts-jest": "^29.1.0",
|
|
57
|
+
"typescript": "^5.1.3"
|
|
58
58
|
},
|
|
59
59
|
"repository": "https://github.com/near/create-near-app.git",
|
|
60
60
|
"author": "Pagoda.co",
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
// React
|
|
2
|
-
import
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import ReactDOM from 'react-dom';
|
|
3
4
|
import App from './App';
|
|
4
5
|
|
|
5
6
|
// NEAR
|
|
@@ -10,14 +11,13 @@ const CONTRACT_ADDRESS = process.env.CONTRACT_NAME
|
|
|
10
11
|
// When creating the wallet you can optionally ask to create an access key
|
|
11
12
|
// Having the key enables to call non-payable methods without interrupting the user to sign
|
|
12
13
|
const wallet = new Wallet({ createAccessKeyFor: CONTRACT_ADDRESS })
|
|
13
|
-
const container = document.getElementById('root');
|
|
14
|
-
const root = createRoot(container); // createRoot(container!) if you use TypeScript
|
|
15
14
|
|
|
16
15
|
// Setup on page load
|
|
17
16
|
window.onload = async () => {
|
|
18
17
|
const isSignedIn = await wallet.startUp()
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
<App isSignedIn={isSignedIn} contractId={CONTRACT_ADDRESS} wallet={wallet}
|
|
18
|
+
|
|
19
|
+
ReactDOM.render(
|
|
20
|
+
<App isSignedIn={isSignedIn} contractId={CONTRACT_ADDRESS} wallet={wallet} />,
|
|
21
|
+
document.getElementById('root')
|
|
22
22
|
);
|
|
23
23
|
}
|
|
@@ -7,34 +7,31 @@
|
|
|
7
7
|
"build": "parcel build index.html --public-url ./"
|
|
8
8
|
},
|
|
9
9
|
"devDependencies": {
|
|
10
|
-
"@babel/core": "^7.
|
|
11
|
-
"@babel/preset-env": "^7.
|
|
12
|
-
"@babel/preset-react": "^7.
|
|
13
|
-
"@types/node": "^
|
|
10
|
+
"@babel/core": "^7.22.5",
|
|
11
|
+
"@babel/preset-env": "^7.22.5",
|
|
12
|
+
"@babel/preset-react": "^7.22.5",
|
|
13
|
+
"@types/node": "^20.3.2",
|
|
14
|
+
"buffer": "^5.5.0||^6.0.0",
|
|
15
|
+
"env-cmd": "^10.1.0",
|
|
16
|
+
"events": "^3.1.0",
|
|
17
|
+
"https-browserify": "^1.0.0",
|
|
18
|
+
"nodemon": "^2.0.22",
|
|
19
|
+
"parcel": "^2.9.3",
|
|
20
|
+
"process": "^0.11.10",
|
|
14
21
|
"react-test-renderer": "^18.2.0",
|
|
22
|
+
"stream-http": "^3.1.0",
|
|
15
23
|
"ts-node": "^10.9.1",
|
|
16
|
-
"typescript": "^
|
|
17
|
-
"
|
|
18
|
-
"parcel": "^2.8.3",
|
|
19
|
-
"process": "^0.11.10",
|
|
20
|
-
"env-cmd": "^10.1.0"
|
|
24
|
+
"typescript": "^5.1.3",
|
|
25
|
+
"url": "^0.11.0"
|
|
21
26
|
},
|
|
22
27
|
"dependencies": {
|
|
23
|
-
"near-
|
|
28
|
+
"@near-wallet-selector/core": "^8.1.4",
|
|
29
|
+
"@near-wallet-selector/modal-ui": "^8.1.4",
|
|
30
|
+
"@near-wallet-selector/my-near-wallet": "^8.1.4",
|
|
31
|
+
"near-api-js": "^2.1.4",
|
|
24
32
|
"react": "^18.2.0",
|
|
25
33
|
"react-dom": "^18.2.0",
|
|
26
|
-
"regenerator-runtime": "^0.13.11"
|
|
27
|
-
"@near-wallet-selector/core": "^7.8.0",
|
|
28
|
-
"@near-wallet-selector/ledger": "^7.8.0",
|
|
29
|
-
"@near-wallet-selector/math-wallet": "^7.8.0",
|
|
30
|
-
"@near-wallet-selector/meteor-wallet": "^7.8.0",
|
|
31
|
-
"@near-wallet-selector/modal-ui": "^7.8.0",
|
|
32
|
-
"@near-wallet-selector/my-near-wallet": "^7.8.0",
|
|
33
|
-
"@near-wallet-selector/near-wallet": "^7.8.0",
|
|
34
|
-
"@near-wallet-selector/nightly": "^7.8.0",
|
|
35
|
-
"@near-wallet-selector/nightly-connect": "^7.8.0",
|
|
36
|
-
"@near-wallet-selector/sender": "^7.8.0",
|
|
37
|
-
"@near-wallet-selector/wallet-connect": "^7.8.0"
|
|
34
|
+
"regenerator-runtime": "^0.13.11"
|
|
38
35
|
},
|
|
39
36
|
"resolutions": {
|
|
40
37
|
"@babel/preset-env": "7.13.8"
|
|
@@ -51,4 +48,4 @@
|
|
|
51
48
|
"last 1 safari version"
|
|
52
49
|
]
|
|
53
50
|
}
|
|
54
|
-
}
|
|
51
|
+
}
|
|
@@ -3,15 +3,10 @@
|
|
|
3
3
|
// near api js
|
|
4
4
|
import { providers } from 'near-api-js';
|
|
5
5
|
|
|
6
|
-
// wallet selector
|
|
6
|
+
// wallet selector
|
|
7
7
|
import '@near-wallet-selector/modal-ui/styles.css';
|
|
8
8
|
import { setupModal } from '@near-wallet-selector/modal-ui';
|
|
9
|
-
import LedgerIconUrl from '@near-wallet-selector/ledger/assets/ledger-icon.png';
|
|
10
|
-
import MyNearIconUrl from '@near-wallet-selector/my-near-wallet/assets/my-near-wallet-icon.png';
|
|
11
|
-
|
|
12
|
-
// wallet selector options
|
|
13
9
|
import { setupWalletSelector } from '@near-wallet-selector/core';
|
|
14
|
-
import { setupLedger } from '@near-wallet-selector/ledger';
|
|
15
10
|
import { setupMyNearWallet } from '@near-wallet-selector/my-near-wallet';
|
|
16
11
|
|
|
17
12
|
const THIRTY_TGAS = '30000000000000';
|
|
@@ -37,8 +32,7 @@ export class Wallet {
|
|
|
37
32
|
async startUp() {
|
|
38
33
|
this.walletSelector = await setupWalletSelector({
|
|
39
34
|
network: this.network,
|
|
40
|
-
modules: [setupMyNearWallet(
|
|
41
|
-
setupLedger({ iconUrl: LedgerIconUrl })],
|
|
35
|
+
modules: [setupMyNearWallet()],
|
|
42
36
|
});
|
|
43
37
|
|
|
44
38
|
const isSignedIn = this.walletSelector.isSignedIn();
|
|
@@ -60,20 +60,17 @@
|
|
|
60
60
|
</p>
|
|
61
61
|
<ol>
|
|
62
62
|
<li>
|
|
63
|
-
Look in <code>index.js</code>
|
|
64
|
-
|
|
65
|
-
What's this?
|
|
63
|
+
Look in <code>index.js</code> - you will see a <code>Wallet</code> object being created and used
|
|
64
|
+
to interact with the methods <code>set_greeting</code> and <code>get_greeting</code>.
|
|
66
65
|
</li>
|
|
67
66
|
<li>
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
<a target="_blank" href="https://docs.near.org/docs/develop/contracts/overview">smart contract</a>.
|
|
67
|
+
These method live in the <a target="_blank" href="https://docs.near.org/docs/develop/contracts/overview">smart contract</a>,
|
|
68
|
+
who's code is defined in the <code>contract/</code> folder.
|
|
71
69
|
</li>
|
|
72
70
|
<li>
|
|
73
|
-
When you run <code>npm run
|
|
74
|
-
<code>
|
|
75
|
-
|
|
76
|
-
<code>scripts</code> section to find the <code>dev</code> command.
|
|
71
|
+
When you run <code>npm run start</code>, the code in <code>contract/</code> gets deployed to the NEAR testnet.
|
|
72
|
+
You can see how this happens by looking in <code>package.json</code> at the <code>scripts</code> section to
|
|
73
|
+
find the <code>dev</code> command.
|
|
77
74
|
</li>
|
|
78
75
|
</ol>
|
|
79
76
|
<hr>
|
|
@@ -9,22 +9,19 @@
|
|
|
9
9
|
"devDependencies": {
|
|
10
10
|
"env-cmd": "^10.1.0",
|
|
11
11
|
"events": "^3.3.0",
|
|
12
|
+
"https-browserify": "^1.0.0",
|
|
12
13
|
"nodemon": "^2.0.16",
|
|
13
14
|
"parcel": "^2.7.0",
|
|
14
|
-
"process": "^0.11.10"
|
|
15
|
+
"process": "^0.11.10",
|
|
16
|
+
"stream-http": "^3.1.0",
|
|
17
|
+
"url": "^0.11.0"
|
|
15
18
|
},
|
|
16
19
|
"dependencies": {
|
|
17
|
-
"@near-wallet-selector/core": "^
|
|
18
|
-
"@near-wallet-selector/ledger": "^
|
|
19
|
-
"@near-wallet-selector/
|
|
20
|
-
"@near-wallet-selector/
|
|
21
|
-
"@near-wallet-selector/
|
|
22
|
-
"
|
|
23
|
-
"@near-wallet-selector/near-wallet": "^7.0.0",
|
|
24
|
-
"@near-wallet-selector/nightly": "^7.0.0",
|
|
25
|
-
"@near-wallet-selector/nightly-connect": "^7.0.0",
|
|
26
|
-
"@near-wallet-selector/sender": "^7.0.0",
|
|
27
|
-
"@near-wallet-selector/wallet-connect": "^7.0.0",
|
|
28
|
-
"near-api-js": "^0.44.2"
|
|
20
|
+
"@near-wallet-selector/core": "^8.1.4",
|
|
21
|
+
"@near-wallet-selector/ledger": "^8.1.4",
|
|
22
|
+
"@near-wallet-selector/modal-ui": "^8.1.4",
|
|
23
|
+
"@near-wallet-selector/my-near-wallet": "^8.1.4",
|
|
24
|
+
"@near-wallet-selector/near-wallet": "^8.1.4",
|
|
25
|
+
"near-api-js": "^2.1.4"
|
|
29
26
|
}
|
|
30
27
|
}
|