create-near-app 3.1.0 → 4.0.0-beta.1.0
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/README.md +11 -11
- package/dist/app.js +98 -0
- package/dist/checks.js +34 -0
- package/dist/make.js +131 -0
- package/dist/messages.js +46 -0
- package/dist/package-json.js +140 -0
- package/dist/tracking.js +34 -0
- package/dist/types.js +3 -0
- package/dist/user-input.js +113 -0
- package/index.js +1 -233
- package/package.json +53 -44
- package/{contracts → templates/contracts}/assemblyscript/README.md +4 -3
- package/templates/contracts/assemblyscript/as-pect.config.js +1 -0
- package/{contracts → templates/contracts}/assemblyscript/asconfig.json +0 -0
- package/{contracts → templates/contracts}/assemblyscript/assembly/__tests__/as-pect.d.ts +0 -0
- package/templates/contracts/assemblyscript/assembly/__tests__/main.spec.ts +11 -0
- package/{contracts → templates/contracts}/assemblyscript/assembly/as_types.d.ts +0 -0
- package/{contracts → templates/contracts}/assemblyscript/assembly/index.ts +5 -5
- package/{contracts → templates/contracts}/assemblyscript/assembly/tsconfig.json +0 -0
- package/templates/contracts/assemblyscript/package.json +14 -0
- package/templates/contracts/assemblyscript/yarn.lock +2952 -0
- package/templates/contracts/js/babel.config.json +7 -0
- package/templates/contracts/js/package.json +18 -0
- package/templates/contracts/js/src/contract.ts +31 -0
- package/templates/contracts/js/tsconfig.json +10 -0
- package/templates/contracts/js/yarn.lock +2534 -0
- package/{contracts → templates/contracts}/rust/.cargo/config +0 -0
- package/{contracts → templates/contracts}/rust/Cargo.toml +1 -1
- package/{contracts → templates/contracts}/rust/README.md +4 -6
- package/{contracts → templates/contracts}/rust/src/lib.rs +0 -0
- package/templates/frontend/react/frontend/App.js +66 -0
- package/templates/{react/frontend/assets/img → frontend/react/frontend/assets}/favicon.ico +0 -0
- package/templates/{vanilla/frontend/assets/css → frontend/react/frontend/assets}/global.css +64 -80
- package/templates/{react/frontend/assets/img → frontend/react/frontend/assets}/logo-black.svg +0 -0
- package/templates/{react/frontend/assets/img → frontend/react/frontend/assets}/logo-white.svg +0 -0
- package/templates/frontend/react/frontend/index.html +15 -0
- package/templates/frontend/react/frontend/index.js +15 -0
- package/templates/{react/frontend/assets/js/near/utils.js → frontend/react/frontend/near-api.js} +19 -19
- package/templates/frontend/react/frontend/near-config.js +61 -0
- package/templates/frontend/react/frontend/package.json +44 -0
- package/templates/frontend/react/frontend/ui-components.js +60 -0
- package/templates/frontend/react/frontend/yarn.lock +4550 -0
- package/templates/{vanilla/frontend/assets/img → frontend/vanilla/frontend/assets}/favicon.ico +0 -0
- package/templates/{react/frontend/assets/css → frontend/vanilla/frontend/assets}/global.css +64 -80
- package/templates/{vanilla/frontend/assets/img → frontend/vanilla/frontend/assets}/logo-black.svg +0 -0
- package/templates/{vanilla/frontend/assets/img → frontend/vanilla/frontend/assets}/logo-white.svg +0 -0
- package/templates/frontend/vanilla/frontend/index.html +86 -0
- package/templates/frontend/vanilla/frontend/index.js +78 -0
- package/templates/{vanilla/frontend/assets/js/near/utils.js → frontend/vanilla/frontend/near-api.js} +18 -18
- package/templates/frontend/vanilla/frontend/near-config.js +62 -0
- package/templates/frontend/vanilla/frontend/package.json +18 -0
- package/templates/frontend/vanilla/frontend/yarn.lock +2328 -0
- package/{integration-tests/js → templates/integration-tests/classic-tests}/ava.config.cjs +9 -9
- package/templates/integration-tests/classic-tests/package.json +17 -0
- package/templates/integration-tests/classic-tests/src/config.ts +34 -0
- package/templates/integration-tests/classic-tests/src/main.ava.ts +32 -0
- package/templates/integration-tests/classic-tests/yarn.lock +1323 -0
- package/{integration-tests → templates/integration-tests/workspaces-tests}/rs/Cargo.toml +0 -0
- package/{integration-tests → templates/integration-tests/workspaces-tests}/rs/src/tests.rs +5 -3
- package/{integration-tests → templates/integration-tests/workspaces-tests}/ts/ava.config.cjs +9 -9
- package/templates/integration-tests/workspaces-tests/ts/package.json +17 -0
- package/templates/integration-tests/workspaces-tests/ts/src/main.ava.ts +45 -0
- package/templates/integration-tests/workspaces-tests/ts/yarn.lock +1653 -0
- package/templates/{none → shared}/.gitpod.yml +0 -0
- package/templates/{vanilla → shared}/README.md +30 -31
- package/templates/{react → shared}/near.gitignore +1 -1
- package/contracts/assemblyscript/as-pect.config.js +0 -1
- package/contracts/assemblyscript/assembly/__tests__/main.spec.ts +0 -11
- package/contracts/assemblyscript/package.json +0 -13
- package/integration-tests/js/package.json +0 -16
- package/integration-tests/js/src/config.ts +0 -31
- package/integration-tests/js/src/main.ava.ts +0 -32
- package/integration-tests/ts/package.json +0 -16
- package/integration-tests/ts/src/main.ava.ts +0 -44
- package/templates/none/.gitattributes +0 -2
- package/templates/none/README.md +0 -101
- package/templates/none/near.gitignore +0 -27
- package/templates/none/neardev/shared-test/test.near.json +0 -1
- package/templates/none/package.json +0 -33
- package/templates/react/.gitpod.yml +0 -6
- package/templates/react/README.md +0 -102
- package/templates/react/ava.config.cjs +0 -9
- package/templates/react/frontend/App.js +0 -202
- package/templates/react/frontend/__mocks__/fileMock.js +0 -3
- package/templates/react/frontend/assets/js/near/config.js +0 -63
- package/templates/react/frontend/index.html +0 -25
- package/templates/react/frontend/index.js +0 -14
- package/templates/react/neardev/shared-test/test.near.json +0 -1
- package/templates/react/package.json +0 -55
- package/templates/vanilla/.gitattributes +0 -2
- package/templates/vanilla/.gitpod.yml +0 -6
- package/templates/vanilla/frontend/assets/js/index.js +0 -74
- package/templates/vanilla/frontend/assets/js/near/config.js +0 -63
- package/templates/vanilla/frontend/index.html +0 -103
- package/templates/vanilla/near.gitignore +0 -27
- package/templates/vanilla/neardev/shared-test/test.near.json +0 -1
- package/templates/vanilla/package.json +0 -34
- package/utils/rust-setup.js +0 -113
- package/utils/tracking.js +0 -29
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "hello_near",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"license": "(MIT AND Apache-2.0)",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"scripts": {
|
|
7
|
+
"build": "near-sdk build src/contract.ts build/hello_near.wasm",
|
|
8
|
+
"deploy": "yarn build && rm -rf neardev && near dev-deploy --wasmFile build/hello_near.wasm && export $(cat ./neardev/dev-account.env) && near call $CONTRACT_NAME init --accountId $CONTRACT_NAME --deposit 1 && echo $CONTRACT_NAME",
|
|
9
|
+
"test": "echo use integration-tests"
|
|
10
|
+
},
|
|
11
|
+
"dependencies": {
|
|
12
|
+
"near-cli": "3.4.0",
|
|
13
|
+
"near-sdk-js": "0.4.0-2"
|
|
14
|
+
},
|
|
15
|
+
"devDependencies": {
|
|
16
|
+
"typescript": "4.7.4"
|
|
17
|
+
}
|
|
18
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { NearBindgen, NearContract, near, call, view } from 'near-sdk-js';
|
|
2
|
+
|
|
3
|
+
// The @NearBindgen decorator allows this code to compile to Base64.
|
|
4
|
+
@NearBindgen
|
|
5
|
+
class MyContract extends NearContract {
|
|
6
|
+
my_greeting: string;
|
|
7
|
+
|
|
8
|
+
constructor() {
|
|
9
|
+
//execute the NEAR Contract's constructor
|
|
10
|
+
super();
|
|
11
|
+
this.my_greeting = 'Hello';
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
// @call indicates that this is a 'change method' or a function
|
|
15
|
+
// that changes state on the blockchain. Change methods cost gas.
|
|
16
|
+
// For more info -> https://docs.near.org/docs/concepts/gas
|
|
17
|
+
@call
|
|
18
|
+
set_greeting({ message }: { message: string }): void {
|
|
19
|
+
near.log(`Saving greeting ${message}`);
|
|
20
|
+
this.my_greeting = message;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
// @view indicates a 'view method' or a function that returns
|
|
24
|
+
// the current values stored on the blockchain. View calls are free
|
|
25
|
+
// and do not cost gas.
|
|
26
|
+
@view
|
|
27
|
+
get_greeting(): string {
|
|
28
|
+
near.log(`The current greeting is ${this.my_greeting}`);
|
|
29
|
+
return this.my_greeting;
|
|
30
|
+
}
|
|
31
|
+
}
|