create-near-app 6.0.3 → 6.1.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.
Files changed (53) hide show
  1. package/README.md +1 -1
  2. package/dist/messages.js +37 -12
  3. package/dist/types.js +1 -1
  4. package/dist/user-input.js +2 -1
  5. package/package.json +1 -1
  6. package/templates/contracts/rs/rust-toolchain.toml +3 -1
  7. package/templates/frontend/next-page/README.md +36 -0
  8. package/templates/frontend/next-page/jsconfig.json +7 -0
  9. package/templates/frontend/next-page/next.config.js +6 -0
  10. package/templates/frontend/next-page/package-lock.json +14642 -0
  11. package/templates/frontend/next-page/package.json +43 -0
  12. package/templates/frontend/next-page/public/favicon.ico +0 -0
  13. package/templates/frontend/next-page/public/near-logo.svg +43 -0
  14. package/templates/frontend/next-page/public/near.svg +1 -0
  15. package/templates/frontend/next-page/public/next.svg +1 -0
  16. package/templates/frontend/next-page/public/vercel.svg +1 -0
  17. package/templates/frontend/next-page/src/components/cards.js +43 -0
  18. package/templates/frontend/next-page/src/components/navigation.js +36 -0
  19. package/templates/frontend/next-page/src/components/vm-component.js +26 -0
  20. package/templates/frontend/next-page/src/config.js +21 -0
  21. package/templates/frontend/next-page/src/layout.js +17 -0
  22. package/templates/frontend/next-page/src/pages/_app.js +10 -0
  23. package/templates/frontend/next-page/src/pages/_document.js +17 -0
  24. package/templates/frontend/next-page/src/pages/hello-components/index.js +48 -0
  25. package/templates/frontend/next-page/src/pages/hello-near/index.js +78 -0
  26. package/templates/frontend/next-page/src/pages/index.js +41 -0
  27. package/templates/frontend/next-page/src/styles/app.module.css +228 -0
  28. package/templates/frontend/next-page/src/styles/globals.css +95 -0
  29. package/templates/frontend/next-page/src/wallets/wallet-selector.js +120 -0
  30. package/templates/frontend/next-page/src/wallets/web3-wallet.ts +289 -0
  31. package/templates/sandbox-tests/sandbox-rs/Cargo.toml +2 -10
  32. package/templates/sandbox-tests/sandbox-rs/src/tests.rs +18 -19
  33. /package/templates/frontend/{next → next-app}/README.md +0 -0
  34. /package/templates/frontend/{next → next-app}/jsconfig.json +0 -0
  35. /package/templates/frontend/{next → next-app}/next.config.js +0 -0
  36. /package/templates/frontend/{next → next-app}/package.json +0 -0
  37. /package/templates/frontend/{next → next-app}/public/near-logo.svg +0 -0
  38. /package/templates/frontend/{next → next-app}/public/near.svg +0 -0
  39. /package/templates/frontend/{next → next-app}/public/next.svg +0 -0
  40. /package/templates/frontend/{next → next-app}/public/vercel.svg +0 -0
  41. /package/templates/frontend/{next → next-app}/src/app/app.module.css +0 -0
  42. /package/templates/frontend/{next → next-app}/src/app/favicon.ico +0 -0
  43. /package/templates/frontend/{next → next-app}/src/app/globals.css +0 -0
  44. /package/templates/frontend/{next → next-app}/src/app/hello-components/page.js +0 -0
  45. /package/templates/frontend/{next → next-app}/src/app/hello-near/page.js +0 -0
  46. /package/templates/frontend/{next → next-app}/src/app/layout.js +0 -0
  47. /package/templates/frontend/{next → next-app}/src/app/page.js +0 -0
  48. /package/templates/frontend/{next → next-app}/src/components/cards.js +0 -0
  49. /package/templates/frontend/{next → next-app}/src/components/navigation.js +0 -0
  50. /package/templates/frontend/{next → next-app}/src/components/vm-component.js +0 -0
  51. /package/templates/frontend/{next → next-app}/src/config.js +0 -0
  52. /package/templates/frontend/{next → next-app}/src/wallets/wallet-selector.js +0 -0
  53. /package/templates/frontend/{next → next-app}/src/wallets/web3-wallet.ts +0 -0
package/README.md CHANGED
@@ -7,7 +7,7 @@ Quickly build apps backed by the [NEAR](https://near.org) blockchain
7
7
 
8
8
  ## Prerequisites
9
9
 
10
- Make sure you have a [current version of Node.js](https://nodejs.org/en/about/releases/) installed – we are targeting versions `16+` for JS contracts and `18+` for frontend/gateways.
10
+ Make sure you have a [current version of Node.js](https://nodejs.org) installed – we are targeting versions `16+` for JS contracts and `18+` for frontend/gateways.
11
11
 
12
12
  Read about other [prerequisites](https://docs.near.org/develop/prerequisites) in our docs.
13
13
 
package/dist/messages.js CHANGED
@@ -24,35 +24,60 @@ Please refer to https://github.com/near/create-near-app README to troubleshoot.
24
24
  Notice: some platforms aren't supported (yet).
25
25
  {bold {red ==========================================}}`);
26
26
  exports.setupFailed = setupFailed;
27
- const successContractToText = (contract) => contract === 'none' ? '' : (0, chalk_1.default) `a smart contract in {bold ${contract === 'rs' ? 'Rust' : 'Typescript'}}`;
27
+ const successContractToText = (contract) => contract === 'none'
28
+ ? ''
29
+ : (0, chalk_1.default) `a smart contract in {bold ${contract === 'rs' ? 'Rust' : 'Typescript'}}`;
28
30
  exports.successContractToText = successContractToText;
29
- const successFrontendToText = (frontend) => frontend === 'none' ? '' : (0, chalk_1.default) `a gateway using ${frontend === 'next' ? 'NextJS + React' : 'Vanilla-JS'}`;
31
+ const frontendTemplates = {
32
+ 'next-page': 'NextJS (Classic)',
33
+ 'next-app': 'NextJS (App Router)',
34
+ vanilla: 'Vanilla-JS',
35
+ };
36
+ const successFrontendToText = (frontend) => frontend === 'none'
37
+ ? ''
38
+ : (0, chalk_1.default) `a gateway using ${frontendTemplates[frontend]}`;
30
39
  exports.successFrontendToText = successFrontendToText;
31
40
  const setupSuccess = (projectName, contract, frontend, install) => (0, exports.show)((0, chalk_1.default) `
32
41
  {green ======================================================}
33
42
  ✅ Success! Created '${projectName}', ${(0, exports.successContractToText)(contract)}${(0, exports.successFrontendToText)(frontend)}.
34
- ${contract === 'rs' ? (0, chalk_1.default) `🦀 If you are new to Rust please visit {bold {green https://www.rust-lang.org }}\n` : ''}
43
+ ${contract === 'rs'
44
+ ? (0, chalk_1.default) `🦀 If you are new to Rust please visit {bold {green https://www.rust-lang.org }}\n`
45
+ : ''}
35
46
  {bold {bgYellow {black Next steps}}}:
36
47
  ${(0, exports.contractInstructions)(projectName, contract, install)}${(0, exports.gatewayInstructions)(projectName, frontend, install)}`);
37
48
  exports.setupSuccess = setupSuccess;
38
- const contractInstructions = (projectName, contract, install) => contract === 'none' ? '' : (0, chalk_1.default) `
49
+ const contractInstructions = (projectName, contract, install) => contract === 'none'
50
+ ? ''
51
+ : (0, chalk_1.default) `
39
52
  - {inverse Navigate to your project}:
40
53
  {blue cd {bold ${projectName}}}
41
- ${contract === 'ts' && !install ? (0, chalk_1.default) ` - {inverse Install all dependencies}
42
- {blue npm {bold install}}` : 'Then:'}
54
+ ${contract === 'ts' && !install
55
+ ? (0, chalk_1.default) ` - {inverse Install all dependencies}
56
+ {blue npm {bold install}}`
57
+ : 'Then:'}
43
58
  - {inverse Build your contract}:
44
- ${contract === 'ts' ? (0, chalk_1.default) `{blue npm {bold run build}}` : (0, chalk_1.default) `{blue {bold ./build.sh}}`}
59
+ ${contract === 'ts'
60
+ ? (0, chalk_1.default) `{blue npm {bold run build}}`
61
+ : (0, chalk_1.default) `{blue {bold ./build.sh}}`}
45
62
  - {inverse Test your contract} in the Sandbox:
46
- ${contract === 'ts' ? (0, chalk_1.default) `{blue npm {bold run test}}` : (0, chalk_1.default) `{blue {bold ./test.sh}}`}
63
+ ${contract === 'ts'
64
+ ? (0, chalk_1.default) `{blue npm {bold run test}}`
65
+ : (0, chalk_1.default) `{blue {bold ./test.sh}}`}
47
66
  - {inverse Deploy your contract} to NEAR TestNet with a temporary dev account:
48
- ${contract === 'ts' ? (0, chalk_1.default) `{blue npm {bold run deploy}}` : (0, chalk_1.default) `{blue {bold ./deploy.sh}}`}
67
+ ${contract === 'ts'
68
+ ? (0, chalk_1.default) `{blue npm {bold run deploy}}`
69
+ : (0, chalk_1.default) `{blue {bold ./deploy.sh}}`}
49
70
  🧠 Read {bold {greenBright README.md}} to explore further`;
50
71
  exports.contractInstructions = contractInstructions;
51
- const gatewayInstructions = (projectName, frontend, install) => frontend === 'none' ? '' : (0, chalk_1.default) `
72
+ const gatewayInstructions = (projectName, frontend, install) => frontend === 'none'
73
+ ? ''
74
+ : (0, chalk_1.default) `
52
75
  - {inverse Navigate to your project}:
53
76
  {blue cd {bold ${projectName}}}
54
- ${!install ? (0, chalk_1.default) ` - {inverse Install all dependencies}
55
- {blue pnpm {bold install}}` : 'Then:'}
77
+ ${!install
78
+ ? (0, chalk_1.default) ` - {inverse Install all dependencies}
79
+ {blue pnpm {bold install}}`
80
+ : 'Then:'}
56
81
  - {inverse Start your app}:
57
82
  {blue pnpm {bold run dev}}`;
58
83
  exports.gatewayInstructions = gatewayInstructions;
package/dist/types.js CHANGED
@@ -2,7 +2,7 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.APPS = exports.TESTING_FRAMEWORKS = exports.FRONTENDS = exports.CONTRACTS = void 0;
4
4
  exports.CONTRACTS = ['ts', 'rs', 'none'];
5
- exports.FRONTENDS = ['next', 'vanilla', 'none'];
5
+ exports.FRONTENDS = ['next-app', 'next-page', 'vanilla', 'none'];
6
6
  exports.TESTING_FRAMEWORKS = ['rs', 'ts', 'none'];
7
7
  exports.APPS = ['contract', 'gateway'];
8
8
  //# sourceMappingURL=types.js.map
@@ -63,7 +63,8 @@ const testsChoices = [
63
63
  { title: 'Tests written in Typescript', value: 'ts' },
64
64
  ];
65
65
  const frontendChoices = [
66
- { title: 'NextJs + React', description: 'A composable app built using Next.js, React and Near components', value: 'next' },
66
+ { title: 'NextJs (Classic)', description: 'A composable app built using Next.js, React and Near components', value: 'next-page' },
67
+ { title: 'NextJS (App Router)', description: 'A composable app built using Next.js, React and Near components', value: 'next-app' },
67
68
  { title: 'Vanilla JS', description: 'A framework-less web app with limited capabilities.', value: 'vanilla' },
68
69
  ];
69
70
  const appPrompt = {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-near-app",
3
- "version": "6.0.3",
3
+ "version": "6.1.1",
4
4
  "description": "Quickly scaffold your dApp on NEAR Blockchain",
5
5
  "main": "index.js",
6
6
  "engines": {
@@ -1,2 +1,4 @@
1
1
  [toolchain]
2
- channel = "1.69"
2
+ channel = "1.73.0"
3
+ components = ["rustfmt"]
4
+ targets = ["wasm32-unknown-unknown"]
@@ -0,0 +1,36 @@
1
+ This is a [Next.js](https://nextjs.org/) project bootstrapped with [`create-next-app`](https://github.com/vercel/next.js/tree/canary/packages/create-next-app).
2
+
3
+ ## Getting Started
4
+
5
+ First, run the development server:
6
+
7
+ ```bash
8
+ npm run dev
9
+ # or
10
+ yarn dev
11
+ # or
12
+ pnpm dev
13
+ # or
14
+ bun dev
15
+ ```
16
+
17
+ Open [http://localhost:3000](http://localhost:3000) with your browser to see the result.
18
+
19
+ You can start editing the page by modifying `app/page.js`. The page auto-updates as you edit the file.
20
+
21
+ This project uses [`next/font`](https://nextjs.org/docs/basic-features/font-optimization) to automatically optimize and load Inter, a custom Google Font.
22
+
23
+ ## Learn More
24
+
25
+ To learn more about Next.js, take a look at the following resources:
26
+
27
+ - [Next.js Documentation](https://nextjs.org/docs) - learn about Next.js features and API.
28
+ - [Learn Next.js](https://nextjs.org/learn) - an interactive Next.js tutorial.
29
+
30
+ You can check out [the Next.js GitHub repository](https://github.com/vercel/next.js/) - your feedback and contributions are welcome!
31
+
32
+ ## Deploy on Vercel
33
+
34
+ The easiest way to deploy your Next.js app is to use the [Vercel Platform](https://vercel.com/new?utm_medium=default-template&filter=next.js&utm_source=create-next-app&utm_campaign=create-next-app-readme) from the creators of Next.js.
35
+
36
+ Check out our [Next.js deployment documentation](https://nextjs.org/docs/deployment) for more details.
@@ -0,0 +1,7 @@
1
+ {
2
+ "compilerOptions": {
3
+ "paths": {
4
+ "@/*": ["./src/*"]
5
+ }
6
+ }
7
+ }
@@ -0,0 +1,6 @@
1
+ /** @type {import('next').NextConfig} */
2
+ const nextConfig = {
3
+ reactStrictMode: true,
4
+ }
5
+
6
+ module.exports = nextConfig;