create-openfort 0.0.13 → 0.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 (108) hide show
  1. package/CHANGELOG.md +23 -0
  2. package/LICENSE +25 -0
  3. package/README.md +63 -0
  4. package/package.json +53 -34
  5. package/template/backend/.editorconfig +10 -0
  6. package/template/backend/.env.example +6 -0
  7. package/template/backend/.gitattributes +4 -0
  8. package/template/backend/README.md +35 -0
  9. package/template/backend/biome.json +33 -0
  10. package/template/backend/package.json +25 -0
  11. package/template/backend/pnpm-lock.yaml +1451 -0
  12. package/template/backend/src/app.ts +77 -0
  13. package/template/backend/tsconfig.json +14 -0
  14. package/template/openfort-templates/firebase/AGENTS.md +169 -0
  15. package/template/openfort-templates/firebase/README.md +65 -0
  16. package/template/openfort-templates/firebase/biome.json +70 -0
  17. package/template/openfort-templates/firebase/index.html +16 -0
  18. package/template/openfort-templates/firebase/package.json +33 -0
  19. package/template/openfort-templates/firebase/public/firebase.svg +14 -0
  20. package/template/openfort-templates/firebase/public/githubLogo.svg +5 -0
  21. package/template/openfort-templates/firebase/public/openfort.svg +13 -0
  22. package/template/openfort-templates/firebase/src/App.tsx +30 -0
  23. package/template/openfort-templates/firebase/src/components/cards/head.tsx +349 -0
  24. package/template/openfort-templates/firebase/src/components/cards/main.tsx +118 -0
  25. package/template/openfort-templates/firebase/src/components/ui/Sheet.tsx +49 -0
  26. package/template/openfort-templates/firebase/src/components/ui/Tabs.tsx +101 -0
  27. package/template/openfort-templates/firebase/src/components/ui/TruncateData.tsx +25 -0
  28. package/template/openfort-templates/firebase/src/index.css +173 -0
  29. package/template/openfort-templates/firebase/src/integrations/firebase/client.ts +20 -0
  30. package/template/openfort-templates/firebase/src/integrations/firebase/components/FirebaseAuthCard.tsx +130 -0
  31. package/template/openfort-templates/firebase/src/integrations/firebase/errors.ts +148 -0
  32. package/template/openfort-templates/firebase/src/integrations/firebase/index.ts +3 -0
  33. package/template/openfort-templates/firebase/src/integrations/openfort/index.ts +1 -0
  34. package/template/openfort-templates/firebase/src/integrations/openfort/providers.tsx +43 -0
  35. package/template/openfort-templates/firebase/src/main.tsx +13 -0
  36. package/template/openfort-templates/firebase/src/ui/openfort/blockchain/ActionsCard.tsx +99 -0
  37. package/template/openfort-templates/firebase/src/ui/openfort/blockchain/SignCard.tsx +96 -0
  38. package/template/openfort-templates/firebase/src/ui/openfort/index.ts +6 -0
  39. package/template/openfort-templates/firebase/src/ui/openfort/profile/UserProfileCard.tsx +73 -0
  40. package/template/openfort-templates/firebase/src/ui/openfort/wallets/WalletCreation.tsx +103 -0
  41. package/template/openfort-templates/firebase/src/ui/openfort/wallets/WalletListCard.tsx +127 -0
  42. package/template/openfort-templates/firebase/src/ui/openfort/wallets/WalletPasswordSheets.tsx +125 -0
  43. package/template/openfort-templates/firebase/src/vite-env.d.ts +1 -0
  44. package/template/openfort-templates/firebase/tsconfig.app.json +28 -0
  45. package/template/openfort-templates/firebase/tsconfig.json +19 -0
  46. package/template/openfort-templates/firebase/tsconfig.node.json +22 -0
  47. package/template/openfort-templates/firebase/vite.config.ts +21 -0
  48. package/template/openfort-templates/headless/AGENTS.md +171 -0
  49. package/template/openfort-templates/headless/README.md +48 -0
  50. package/template/openfort-templates/headless/biome.json +70 -0
  51. package/template/openfort-templates/headless/index.html +16 -0
  52. package/template/openfort-templates/headless/package.json +32 -0
  53. package/template/openfort-templates/headless/public/githubLogo.svg +5 -0
  54. package/template/openfort-templates/headless/public/openfort.svg +13 -0
  55. package/template/openfort-templates/headless/public/reactLogo.svg +14 -0
  56. package/template/openfort-templates/headless/src/App.tsx +9 -0
  57. package/template/openfort-templates/headless/src/components/cards/actions.tsx +108 -0
  58. package/template/openfort-templates/headless/src/components/cards/auth.tsx +158 -0
  59. package/template/openfort-templates/headless/src/components/cards/head.tsx +349 -0
  60. package/template/openfort-templates/headless/src/components/cards/main.tsx +118 -0
  61. package/template/openfort-templates/headless/src/components/cards/profile.tsx +92 -0
  62. package/template/openfort-templates/headless/src/components/cards/sign.tsx +111 -0
  63. package/template/openfort-templates/headless/src/components/cards/wallets.tsx +136 -0
  64. package/template/openfort-templates/headless/src/components/createWallet.tsx +88 -0
  65. package/template/openfort-templates/headless/src/components/passwordRecovery.tsx +142 -0
  66. package/template/openfort-templates/headless/src/components/providers.tsx +41 -0
  67. package/template/openfort-templates/headless/src/components/ui/Sheet.tsx +49 -0
  68. package/template/openfort-templates/headless/src/components/ui/Tabs.tsx +101 -0
  69. package/template/openfort-templates/headless/src/components/ui/TruncateData.tsx +25 -0
  70. package/template/openfort-templates/headless/src/index.css +187 -0
  71. package/template/openfort-templates/headless/src/main.tsx +13 -0
  72. package/template/openfort-templates/headless/src/vite-env.d.ts +1 -0
  73. package/template/openfort-templates/headless/tsconfig.app.json +30 -0
  74. package/template/openfort-templates/headless/tsconfig.json +7 -0
  75. package/template/openfort-templates/headless/tsconfig.node.json +26 -0
  76. package/template/openfort-templates/headless/vite.config.ts +8 -0
  77. package/template/openfort-templates/openfort-ui/AGENTS.md +225 -0
  78. package/template/openfort-templates/openfort-ui/README.md +48 -0
  79. package/template/openfort-templates/openfort-ui/biome.json +70 -0
  80. package/template/openfort-templates/openfort-ui/index.html +16 -0
  81. package/template/openfort-templates/openfort-ui/package.json +32 -0
  82. package/template/openfort-templates/openfort-ui/public/githubLogo.svg +5 -0
  83. package/template/openfort-templates/openfort-ui/public/openfort.svg +13 -0
  84. package/template/openfort-templates/openfort-ui/public/reactLogo.svg +14 -0
  85. package/template/openfort-templates/openfort-ui/src/App.tsx +9 -0
  86. package/template/openfort-templates/openfort-ui/src/components/cards/actions.tsx +105 -0
  87. package/template/openfort-templates/openfort-ui/src/components/cards/auth.tsx +43 -0
  88. package/template/openfort-templates/openfort-ui/src/components/cards/head.tsx +349 -0
  89. package/template/openfort-templates/openfort-ui/src/components/cards/main.tsx +119 -0
  90. package/template/openfort-templates/openfort-ui/src/components/cards/profile.tsx +92 -0
  91. package/template/openfort-templates/openfort-ui/src/components/cards/sign.tsx +111 -0
  92. package/template/openfort-templates/openfort-ui/src/components/cards/wallets.tsx +134 -0
  93. package/template/openfort-templates/openfort-ui/src/components/createWallet.tsx +88 -0
  94. package/template/openfort-templates/openfort-ui/src/components/passwordRecovery.tsx +142 -0
  95. package/template/openfort-templates/openfort-ui/src/components/providers.tsx +47 -0
  96. package/template/openfort-templates/openfort-ui/src/components/ui/Sheet.tsx +49 -0
  97. package/template/openfort-templates/openfort-ui/src/components/ui/Tabs.tsx +101 -0
  98. package/template/openfort-templates/openfort-ui/src/components/ui/TruncateData.tsx +25 -0
  99. package/template/openfort-templates/openfort-ui/src/index.css +187 -0
  100. package/template/openfort-templates/openfort-ui/src/main.tsx +13 -0
  101. package/template/openfort-templates/openfort-ui/src/vite-env.d.ts +1 -0
  102. package/template/openfort-templates/openfort-ui/tsconfig.app.json +30 -0
  103. package/template/openfort-templates/openfort-ui/tsconfig.json +7 -0
  104. package/template/openfort-templates/openfort-ui/tsconfig.node.json +26 -0
  105. package/template/openfort-templates/openfort-ui/vite.config.ts +8 -0
  106. package/dist/chunks/multipart-parser.mjs +0 -2
  107. package/dist/index.mjs +0 -106
  108. package/index.js +0 -3
package/CHANGELOG.md ADDED
@@ -0,0 +1,23 @@
1
+ # Changelog
2
+
3
+ ## 0.1.1
4
+
5
+ ### Patch Changes
6
+
7
+ - [#108](https://github.com/openfort-xyz/openfort-react/pull/108) [`24e89e7`](https://github.com/openfort-xyz/openfort-react/commit/24e89e7563a512ac355cec14f5353389ad3c4a47) Thanks [@martimayoral](https://github.com/martimayoral)! - fix build
8
+
9
+ ## 0.1.0
10
+
11
+ ### Minor Changes
12
+
13
+ - [#97](https://github.com/openfort-xyz/openfort-react/pull/97) [`023e3b4`](https://github.com/openfort-xyz/openfort-react/commit/023e3b43c7374792391df8388336e9e7a8dc3d8b) Thanks [@Huguet57](https://github.com/Huguet57)! - Optimized internal configuration
14
+
15
+ ## 0.1.0
16
+
17
+ ### Initial Release
18
+
19
+ - Initial release of create-openfort CLI
20
+ - Support for multiple authentication providers (Firebase, Headless, Openfort UI)
21
+ - Backend integration with Openfort SDK
22
+ - TypeScript support out of the box
23
+ - Modern development experience with Vite and React
package/LICENSE ADDED
@@ -0,0 +1,25 @@
1
+ BSD 2-Clause License
2
+
3
+ Copyright (c) 2022, LFE, Inc.
4
+ All rights reserved.
5
+
6
+ Redistribution and use in source and binary forms, with or without
7
+ modification, are permitted provided that the following conditions are met:
8
+
9
+ 1. Redistributions of source code must retain the above copyright notice, this
10
+ list of conditions and the following disclaimer.
11
+
12
+ 2. Redistributions in binary form must reproduce the above copyright notice,
13
+ this list of conditions and the following disclaimer in the documentation
14
+ and/or other materials provided with the distribution.
15
+
16
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
17
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
18
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
19
+ DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
20
+ FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
21
+ DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
22
+ SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
23
+ CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
24
+ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
25
+ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
package/README.md ADDED
@@ -0,0 +1,63 @@
1
+ <h1 align="center">
2
+ create-openfort
3
+ </h1>
4
+
5
+ <p align="center">
6
+ Interactive CLI to start a Web3 app with Openfort embedded wallets.
7
+ </p>
8
+
9
+ <p align="center">
10
+ Get started by running <code>npm create openfort@latest</code>
11
+ </p>
12
+
13
+ ## Table of contents
14
+
15
+ - <a href="#about">About</a>
16
+ - <a href="#getting-started">Getting Started</a>
17
+ - <a href="#community">Community</a>
18
+
19
+ <h2 id="about">Create Openfort App</h2>
20
+
21
+ `create-openfort` is a CLI tool to quickly scaffold Web3 applications with Openfort's embedded wallet infrastructure. Build blockchain-enabled apps with ease using modern frameworks and best practices.
22
+
23
+ ### Features
24
+
25
+ - Interactive CLI for quick project setup
26
+ - Support for multiple authentication providers (Firebase, Headless, Openfort UI)
27
+ - Backend integration with Openfort SDK
28
+ - TypeScript support out of the box
29
+ - Modern development experience with Vite and React
30
+
31
+ <h2 id="getting-started">Getting Started</h2>
32
+
33
+ To scaffold an app using `create-openfort`, run any of the following commands:
34
+
35
+ ### npm
36
+
37
+ ```bash
38
+ npm create openfort@latest
39
+ ```
40
+
41
+ ### yarn
42
+
43
+ ```bash
44
+ yarn create openfort
45
+ ```
46
+
47
+ ### pnpm
48
+
49
+ ```bash
50
+ pnpm create openfort@latest
51
+ ```
52
+
53
+ ### bun
54
+
55
+ ```bash
56
+ bun create openfort@latest
57
+ ```
58
+
59
+ <h2 id="community">Community</h2>
60
+
61
+ For help, discussion about best practices, or any other conversation that would benefit create-openfort:
62
+
63
+ [Join the Openfort Telegram Group](https://t.me/openfort)
package/package.json CHANGED
@@ -1,44 +1,63 @@
1
1
  {
2
2
  "name": "create-openfort",
3
- "version": "0.0.13",
4
- "type": "module",
3
+ "version": "0.1.1",
4
+ "description": "Create Openfort applications with embedded wallets",
5
5
  "license": "MIT",
6
6
  "author": "Openfort (https://www.openfort.xyz)",
7
- "bin": "index.js",
8
- "files": [
9
- "index.js",
10
- "dist"
7
+ "repository": {
8
+ "type": "git",
9
+ "url": "https://github.com/openfort-xyz/openfort-react.git",
10
+ "directory": "packages/create-openfort"
11
+ },
12
+ "keywords": [
13
+ "create-openfort",
14
+ "openfort",
15
+ "embedded-wallets",
16
+ "web3",
17
+ "blockchain",
18
+ "react",
19
+ "vite",
20
+ "typescript"
11
21
  ],
12
- "scripts": {
13
- "dev": "unbuild --watch",
14
- "test": "vitest run",
15
- "test:watch": "vitest",
16
- "test:ui": "vitest --ui",
17
- "test:coverage": "vitest run --coverage",
18
- "test:integration": "node -e \"require('fs').mkdirSync('tests', { recursive: true });\" && cd tests && node ./../index.js",
19
- "build": "unbuild && node build.js",
20
- "lint": "tsc --noEmit"
22
+ "type": "module",
23
+ "exports": "./dist/index.js",
24
+ "bin": {
25
+ "create-openfort": "./dist/index.js"
21
26
  },
27
+ "files": [
28
+ "dist",
29
+ "template",
30
+ "README.md",
31
+ "LICENSE",
32
+ "CHANGELOG.md",
33
+ ".yarnrc.yml",
34
+ "package.json"
35
+ ],
22
36
  "engines": {
23
- "node": "^18.0.0 || ^20.0.0 || >=22.0.0"
37
+ "node": ">=18.17.0"
38
+ },
39
+ "dependencies": {
40
+ "@clack/prompts": "^0.6.3",
41
+ "chalk": "5.2.0",
42
+ "commander": "^10.0.1",
43
+ "execa": "^7.2.0",
44
+ "fs-extra": "^11.2.0",
45
+ "gradient-string": "^2.0.2",
46
+ "ora": "6.3.1"
24
47
  },
25
48
  "devDependencies": {
26
- "@clack/prompts": "^0.10.0",
27
- "@openfort/react": "^0.0.17",
28
- "@types/cross-spawn": "^6.0.6",
29
- "@types/node": "^24.7.0",
30
- "@vitest/coverage-v8": "^3.2.4",
31
- "@vitest/ui": "^3.2.4",
32
- "cross-spawn": "^7.0.6",
33
- "mri": "^1.2.0",
34
- "node-fetch": "^3.3.2",
35
- "picocolors": "^1.1.1",
36
- "react": "^18.0.0",
37
- "react-dom": "^18.0.0",
38
- "typescript": "^5.0.4",
39
- "unbuild": "^3.5.0",
40
- "viem": "^2.23.2",
41
- "vitest": "^3.2.4",
42
- "wagmi": "^2.14.11"
49
+ "@biomejs/biome": "^2.2.4",
50
+ "@types/fs-extra": "^11.0.4",
51
+ "@types/gradient-string": "^1.1.6",
52
+ "@types/node": "^20.14.10",
53
+ "tsup": "^6.7.0",
54
+ "type-fest": "^3.13.1",
55
+ "typescript": "^5.8.2"
56
+ },
57
+ "scripts": {
58
+ "check": "tsc && biome check",
59
+ "build": "tsup",
60
+ "dev": "tsup --watch",
61
+ "start": "node dist/index.js"
43
62
  }
44
- }
63
+ }
@@ -0,0 +1,10 @@
1
+ root = true
2
+
3
+ [*]
4
+ end_of_line = lf
5
+ insert_final_newline = true
6
+
7
+ [*.{js,json,yml}]
8
+ charset = utf-8
9
+ indent_style = space
10
+ indent_size = 2
@@ -0,0 +1,6 @@
1
+ OPENFORT_SECRET_KEY=
2
+ SHIELD_API_KEY=
3
+ SHIELD_SECRET_KEY=
4
+ SHIELD_ENCRYPTION_SHARE=
5
+
6
+ PORT=
@@ -0,0 +1,4 @@
1
+ /.yarn/** linguist-vendored
2
+ /.yarn/releases/* binary
3
+ /.yarn/plugins/**/* binary
4
+ /.pnp.* binary linguist-generated
@@ -0,0 +1,35 @@
1
+ # Openfort backend quickstart
2
+
3
+ This is a sample for a simple backend to create an encryption session for [openfort Signer](https://www.openfort.io/docs/guides/javascript/embedded-signer/recovery)
4
+
5
+ ## Set up
6
+
7
+ 1. **Copy environment variables:**
8
+
9
+ ```sh
10
+ cp .env.example .env
11
+ ```
12
+
13
+ Edit `.env` and set the required variables
14
+
15
+ 2. **Install dependencies:**
16
+
17
+ ```sh
18
+ pnpm install
19
+ ```
20
+
21
+ 3. **Start the development server:**
22
+
23
+ ```sh
24
+ pnpm dev
25
+ ```
26
+
27
+ ## What does it provide?
28
+
29
+ Do a post to `/api/protected-create-encryption-session` and you will response a session like:
30
+
31
+ ```json
32
+ {
33
+ "session": "cb44a4a1-5867-4b25-b5a0-57b496e14d78"
34
+ }
35
+ ```
@@ -0,0 +1,33 @@
1
+ {
2
+ "$schema": "https://biomejs.dev/schemas/1.9.4/schema.json",
3
+ "vcs": {
4
+ "enabled": true,
5
+ "clientKind": "git",
6
+ "useIgnoreFile": true
7
+ },
8
+ "files": {
9
+ "ignoreUnknown": false,
10
+ "ignore": ["node_modules", "dist", "build", "*.log"]
11
+ },
12
+ "formatter": {
13
+ "enabled": true,
14
+ "indentStyle": "space",
15
+ "indentWidth": 2,
16
+ "lineWidth": 100
17
+ },
18
+ "organizeImports": {
19
+ "enabled": true
20
+ },
21
+ "linter": {
22
+ "enabled": true,
23
+ "rules": {
24
+ "recommended": true
25
+ }
26
+ },
27
+ "javascript": {
28
+ "formatter": {
29
+ "quoteStyle": "single",
30
+ "semicolons": "always"
31
+ }
32
+ }
33
+ }
@@ -0,0 +1,25 @@
1
+ {
2
+ "name": "auth-sample-backend",
3
+ "packageManager": "pnpm@9.15.4",
4
+ "dependencies": {
5
+ "@openfort/openfort-node": "^0.6.75",
6
+ "cors": "^2.8.5",
7
+ "express": "^4.21.2"
8
+ },
9
+ "devDependencies": {
10
+ "@biomejs/biome": "^1.9.4",
11
+ "@types/cors": "^2.8.17",
12
+ "@types/express": "^5.0.0",
13
+ "@types/node": "^22.13.5",
14
+ "ts-node-dev": "^2.0.0",
15
+ "typescript": "^5.7.3"
16
+ },
17
+ "scripts": {
18
+ "build": "tsc",
19
+ "start": "node dist/app.js",
20
+ "dev": "ts-node-dev src/app.ts",
21
+ "format": "biome format --write .",
22
+ "lint": "biome lint .",
23
+ "check": "biome check --write ."
24
+ }
25
+ }