@pasosdejesus/m 0.30.1 → 0.31.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/dist/CHANGELOG.md +54 -0
- package/dist/blockchain/deployments.d.ts +2 -1
- package/dist/blockchain/deployments.d.ts.map +1 -1
- package/dist/blockchain/deployments.js +4 -3
- package/dist/blockchain/deployments.js.map +1 -1
- package/dist/compose/data.d.ts +20 -1
- package/dist/compose/data.d.ts.map +1 -1
- package/dist/compose/data.js +50 -3
- package/dist/compose/data.js.map +1 -1
- package/dist/compose/index.d.ts +1 -1
- package/dist/compose/index.d.ts.map +1 -1
- package/dist/compose/index.js +1 -1
- package/dist/compose/index.js.map +1 -1
- package/dist/e2e/browser.d.ts.map +1 -1
- package/dist/e2e/browser.js +7 -19
- package/dist/e2e/browser.js.map +1 -1
- package/dist/e2e/env.js +1 -1
- package/dist/e2e/env.js.map +1 -1
- package/dist/e2e/full-wallet.d.ts.map +1 -1
- package/dist/e2e/full-wallet.js +5 -1
- package/dist/e2e/full-wallet.js.map +1 -1
- package/dist/e2e/wallet-mock.d.ts.map +1 -1
- package/dist/e2e/wallet-mock.js +13 -14
- package/dist/e2e/wallet-mock.js.map +1 -1
- package/dist/i18n/locales/cli.js +4 -4
- package/dist/i18n/locales/cli.js.map +1 -1
- package/dist/m.js +2 -1
- package/dist/m.js.map +1 -1
- package/dist/tasks/create.js +8 -8
- package/dist/tasks/create.js.map +1 -1
- package/dist/tasks/engine.d.ts.map +1 -1
- package/dist/tasks/engine.js +12 -4
- package/dist/tasks/engine.js.map +1 -1
- package/dist/tasks/update.d.ts.map +1 -1
- package/dist/tasks/update.js +4 -1
- package/dist/tasks/update.js.map +1 -1
- package/dist/templates/AGENTS.md.hbs +8 -8
- package/dist/templates/ARCHITECTURE.md.hbs +10 -10
- package/dist/templates/CONTRIBUTING.md.hbs +5 -5
- package/dist/templates/Makefile +21 -9
- package/dist/templates/README.md.hbs +18 -11
- package/dist/templates/apps/{hardhat → contracts}/Makefile +4 -4
- package/dist/templates/apps/{hardhat → contracts}/README.md +2 -2
- package/dist/templates/apps/{hardhat/package.json → contracts/package.json.hbs} +6 -7
- package/dist/templates/apps/{hardhat → contracts}/scripts/sync-usdt.mjs +2 -2
- package/dist/templates/apps/{hardhat → contracts}/sync-abis.mjs +4 -4
- package/dist/templates/apps/{nextjs → web}/Makefile +0 -4
- package/dist/templates/apps/{nextjs → web}/package.json.hbs +12 -14
- package/dist/templates/package.json.hbs +12 -0
- package/dist/templates/pnpm-workspace.yaml.hbs +42 -0
- package/dist/util/engines.d.ts +1 -1
- package/dist/util/engines.js +1 -1
- package/package.json +2 -2
- package/src/blockchain/README.md +1 -1
- package/src/shadcn_components/README.md +2 -2
- package/src/wallet/README.md +15 -0
- package/dist/templates/apps/nextjs/pnpm-workspace.yaml +0 -13
- /package/dist/templates/apps/{hardhat → contracts}/.prettierrc +0 -0
- /package/dist/templates/apps/{hardhat → contracts}/MOCK_USDT_README.md +0 -0
- /package/dist/templates/apps/{hardhat → contracts}/bin/MusdtVerification +0 -0
- /package/dist/templates/apps/{hardhat → contracts}/bin/approveDepositOwner +0 -0
- /package/dist/templates/apps/{hardhat → contracts}/bin/contractVerification +0 -0
- /package/dist/templates/apps/{hardhat → contracts}/bin/deployMockUSDT +0 -0
- /package/dist/templates/apps/{hardhat → contracts}/bin/prepadJ.sh +0 -0
- /package/dist/templates/apps/{hardhat → contracts}/bin/verifyMockUSDT +0 -0
- /package/dist/templates/apps/{hardhat → contracts}/hardhat.config.ts +0 -0
- /package/dist/templates/apps/{hardhat → contracts}/scripts/approveDepositOwner.ts +0 -0
- /package/dist/templates/apps/{hardhat → contracts}/scripts/deployMockUSDT.ts +0 -0
- /package/dist/templates/apps/{hardhat → contracts}/scripts/verifyDeployment.ts +0 -0
- /package/dist/templates/apps/{hardhat → contracts}/scripts/verifyMockUSDT.ts +0 -0
- /package/dist/templates/apps/{hardhat → contracts}/tsconfig.json +0 -0
- /package/dist/templates/apps/{nextjs → web}/.config/kysely.config.ts +0 -0
- /package/dist/templates/apps/{nextjs → web}/README.md.hbs +0 -0
- /package/dist/templates/apps/{nextjs → web}/abis/IERC20.json +0 -0
- /package/dist/templates/apps/{nextjs → web}/abis/MockUSDT.json +0 -0
- /package/dist/templates/apps/{nextjs → web}/abis/ReentrancyGuard.json +0 -0
- /package/dist/templates/apps/{nextjs → web}/app/globals.css +0 -0
- /package/dist/templates/apps/{nextjs → web}/app/layout.tsx.hbs +0 -0
- /package/dist/templates/apps/{nextjs → web}/app/page.tsx.hbs +0 -0
- /package/dist/templates/apps/{nextjs → web}/app/testui/page.tsx +0 -0
- /package/dist/templates/apps/{nextjs → web}/bin/m +0 -0
- /package/dist/templates/apps/{nextjs → web}/components.json +0 -0
- /package/dist/templates/apps/{nextjs → web}/next-env.d.ts +0 -0
- /package/dist/templates/apps/{nextjs → web}/next.config.ts +0 -0
- /package/dist/templates/apps/{nextjs → web}/postcss.config.mjs +0 -0
- /package/dist/templates/apps/{nextjs → web}/tailwind.config.js +0 -0
- /package/dist/templates/apps/{nextjs → web}/tests/global-setup.ts +0 -0
- /package/dist/templates/apps/{nextjs → web}/tests/helpers.ts +0 -0
- /package/dist/templates/apps/{nextjs → web}/tests/setup-env.ts.hbs +0 -0
- /package/dist/templates/apps/{nextjs → web}/tsconfig.json +0 -0
- /package/dist/templates/apps/{nextjs → web}/vitest.config.ts +0 -0
|
@@ -8,12 +8,12 @@ Generated with **m** — a CLI for Next.js + PostgreSQL + Hardhat.
|
|
|
8
8
|
|
|
9
9
|
## Quick Test (no PostgreSQL required)
|
|
10
10
|
|
|
11
|
-
|
|
11
|
+
`pnpm install` instala **todo el workspace** (`apps/web`, `apps/contracts` y los motores
|
|
12
|
+
vendorizados en `packages/generated/*`); luego arranca el servidor de Next:
|
|
12
13
|
|
|
13
14
|
```bash
|
|
14
|
-
|
|
15
|
-
pnpm
|
|
16
|
-
pnpm dev
|
|
15
|
+
pnpm install # una sola instalación para todas las apps
|
|
16
|
+
cd apps/web && pnpm dev
|
|
17
17
|
```
|
|
18
18
|
|
|
19
19
|
Open http://localhost:3000 — you should see the welcome page.
|
|
@@ -32,7 +32,7 @@ npm install -g pnpm@10
|
|
|
32
32
|
If using Hardhat on OpenBSD/adJ, run the preparation script:
|
|
33
33
|
|
|
34
34
|
```bash
|
|
35
|
-
cd apps/
|
|
35
|
+
cd apps/contracts && bin/prepadJ.sh
|
|
36
36
|
```
|
|
37
37
|
|
|
38
38
|
### 2. Configure environment
|
|
@@ -50,7 +50,7 @@ Key variables for OpenBSD/adJ:
|
|
|
50
50
|
### 3. Create the database
|
|
51
51
|
|
|
52
52
|
```bash
|
|
53
|
-
cd apps/
|
|
53
|
+
cd apps/web
|
|
54
54
|
./bin/m db:super:createuser
|
|
55
55
|
./bin/m db:migrate
|
|
56
56
|
```
|
|
@@ -58,17 +58,22 @@ cd apps/nextjs
|
|
|
58
58
|
### 4. Start development
|
|
59
59
|
|
|
60
60
|
```bash
|
|
61
|
-
cd apps/
|
|
61
|
+
cd apps/web && pnpm dev
|
|
62
62
|
```
|
|
63
63
|
|
|
64
64
|
## Project Structure
|
|
65
65
|
|
|
66
|
-
- `
|
|
67
|
-
|
|
66
|
+
- `package.json` + `pnpm-workspace.yaml` — **workspace raíz**: un lockfile, una instalación y
|
|
67
|
+
versiones compartidas por **catálogo** (`@pasosdejesus/*`, `next`, `react`, `viem`, …)
|
|
68
|
+
- `apps/web/` — Next.js frontend with Rails-like backend (incluye `bin/m`)
|
|
69
|
+
- `apps/contracts/` — Solidity smart contracts (Hardhat)
|
|
70
|
+
- `packages/generated/` — motores vendorizados (`bin/m eng:sync --vendor`)
|
|
68
71
|
- `apps/.env` — Unified environment config
|
|
69
72
|
|
|
70
73
|
## Available Commands
|
|
71
74
|
|
|
75
|
+
Comandos (desde `apps/web`):
|
|
76
|
+
|
|
72
77
|
```bash
|
|
73
78
|
./bin/m --help # All commands (adapts to your project)
|
|
74
79
|
./bin/m db:create # Create database
|
|
@@ -87,10 +92,12 @@ cd apps/nextjs && pnpm dev
|
|
|
87
92
|
## Testing
|
|
88
93
|
|
|
89
94
|
```bash
|
|
90
|
-
cd apps/
|
|
91
|
-
cd apps/
|
|
95
|
+
cd apps/web && pnpm test
|
|
96
|
+
cd apps/contracts && pnpm test
|
|
92
97
|
```
|
|
93
98
|
|
|
99
|
+
Desde la raíz: `make test` y `make type` corren ambos; `make all` instala (y compila).
|
|
100
|
+
|
|
94
101
|
## Troubleshooting
|
|
95
102
|
|
|
96
103
|
### pnpm issues on OpenBSD
|
|
@@ -70,7 +70,7 @@ Runs `hardhat test` with the built-in Hardhat Network (requires native EDR binar
|
|
|
70
70
|
### OpenBSD / adJ
|
|
71
71
|
|
|
72
72
|
```sh
|
|
73
|
-
cd ../
|
|
73
|
+
cd ../web && pnpm contract:test
|
|
74
74
|
```
|
|
75
75
|
|
|
76
76
|
Uses `@ethereumjs/vm` fallback via `@pasosdejesus/edr`. Run from the
|
|
@@ -78,7 +78,7 @@ nextjs app directory.
|
|
|
78
78
|
|
|
79
79
|
## ABI Synchronization
|
|
80
80
|
|
|
81
|
-
ABIs are synced to `../
|
|
81
|
+
ABIs are synced to `../web/abis/` automatically on `pnpm build`.
|
|
82
82
|
Manual sync: `pnpm sync:abis`.
|
|
83
83
|
|
|
84
84
|
## Best Practices
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"name": "
|
|
2
|
+
"name": "{{name}}-contracts",
|
|
3
3
|
"license": "MIT",
|
|
4
4
|
"version": "1.0.0",
|
|
5
5
|
"devDependencies": {
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
"@typechain/hardhat": "^9.1.0",
|
|
15
15
|
"@types/chai": "^5.2.3",
|
|
16
16
|
"@types/mocha": "^10.0.7",
|
|
17
|
-
"@pasosdejesus/usdt": "
|
|
17
|
+
"@pasosdejesus/usdt": "catalog:",
|
|
18
18
|
"chai": "^4.2.0",
|
|
19
19
|
"ethers": "^6.15.0",
|
|
20
20
|
"hardhat": ">=2.27.0 <3.0.0",
|
|
@@ -24,13 +24,13 @@
|
|
|
24
24
|
"ts-node": "^10.9.2",
|
|
25
25
|
"typechain": "^8.3.2",
|
|
26
26
|
"tsx": "^4.21.0",
|
|
27
|
-
"typescript": "
|
|
27
|
+
"typescript": "catalog:"
|
|
28
28
|
},
|
|
29
29
|
"dependencies": {
|
|
30
30
|
"@nomicfoundation/hardhat-ignition": "0.15.0",
|
|
31
31
|
"@openzeppelin/contracts": "^5.4.0",
|
|
32
|
-
"dotenv": "
|
|
33
|
-
"viem": "
|
|
32
|
+
"dotenv": "catalog:",
|
|
33
|
+
"viem": "catalog:"
|
|
34
34
|
},
|
|
35
35
|
"scripts": {
|
|
36
36
|
"postinstall": "chmod +x sync-abis.mjs",
|
|
@@ -51,6 +51,5 @@
|
|
|
51
51
|
"prettier": "prettier --write 'contracts/**/*.sol' '**/*.ts'",
|
|
52
52
|
"sync:abis": "node sync-abis.mjs"
|
|
53
53
|
},
|
|
54
|
-
"author": "pasosdeJesus"
|
|
55
|
-
"packageManager": "pnpm@10.34.5"
|
|
54
|
+
"author": "pasosdeJesus"
|
|
56
55
|
}
|
|
@@ -8,8 +8,8 @@
|
|
|
8
8
|
// (derivado, no se edita a mano).
|
|
9
9
|
//
|
|
10
10
|
// Funciona desde cualquier proyecto cuyo node_modules tenga el paquete
|
|
11
|
-
// (apps/
|
|
12
|
-
// node_modules de apps/
|
|
11
|
+
// (apps/contracts con link:, o packages/<motor>/contracts con symlink al
|
|
12
|
+
// node_modules de apps/contracts).
|
|
13
13
|
import { cpSync, existsSync } from 'fs'
|
|
14
14
|
import { join } from 'path'
|
|
15
15
|
|
|
@@ -5,11 +5,11 @@ import path from 'path'
|
|
|
5
5
|
|
|
6
6
|
// Configuration - directory files
|
|
7
7
|
const HARDHAT_ARTIFACTS_PATH = './artifacts/contracts'
|
|
8
|
-
const
|
|
8
|
+
const WEB_ABI_PATH = '../web/abis'
|
|
9
9
|
|
|
10
10
|
// Create the React ABI directory if it doesn't exist
|
|
11
|
-
if (!fs.existsSync(
|
|
12
|
-
fs.mkdirSync(
|
|
11
|
+
if (!fs.existsSync(WEB_ABI_PATH)) {
|
|
12
|
+
fs.mkdirSync(WEB_ABI_PATH, { recursive: true })
|
|
13
13
|
}
|
|
14
14
|
|
|
15
15
|
// Function to walk through directories recursively
|
|
@@ -45,7 +45,7 @@ try {
|
|
|
45
45
|
const contractName = filename.replace('.json', '')
|
|
46
46
|
|
|
47
47
|
// Extract just the ABI and save it to the Next.js directory
|
|
48
|
-
const abiPath = path.join(
|
|
48
|
+
const abiPath = path.join(WEB_ABI_PATH, `${contractName}.json`)
|
|
49
49
|
fs.writeFileSync(abiPath, JSON.stringify(artifact.abi, null, 2))
|
|
50
50
|
console.log(`Copied ABI for ${contractName}`)
|
|
51
51
|
})
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
|
|
2
1
|
{
|
|
3
|
-
"name": "{{name}}",
|
|
2
|
+
"name": "{{name}}-web",
|
|
4
3
|
"version": "0.0.0",
|
|
5
4
|
"description": "{{description}}",
|
|
6
5
|
"type": "module",
|
|
@@ -16,13 +15,13 @@
|
|
|
16
15
|
"author": "",
|
|
17
16
|
"license": "ISC",
|
|
18
17
|
"dependencies": {
|
|
19
|
-
"@pasosdejesus/m": "
|
|
20
|
-
"dotenv": "
|
|
21
|
-
"kysely-postgres-js": "
|
|
22
|
-
"next": "
|
|
23
|
-
"pg": "
|
|
24
|
-
"react": "
|
|
25
|
-
"react-dom": "
|
|
18
|
+
"@pasosdejesus/m": "catalog:",
|
|
19
|
+
"dotenv": "catalog:",
|
|
20
|
+
"kysely-postgres-js": "catalog:",
|
|
21
|
+
"next": "catalog:",
|
|
22
|
+
"pg": "catalog:",
|
|
23
|
+
"react": "catalog:",
|
|
24
|
+
"react-dom": "catalog:"
|
|
26
25
|
},
|
|
27
26
|
"devDependencies": {
|
|
28
27
|
"@testing-library/react": "16.3.2",
|
|
@@ -33,17 +32,16 @@
|
|
|
33
32
|
"autoprefixer": "^10.5.0",
|
|
34
33
|
"dotenv-cli": "^7.4.4",
|
|
35
34
|
"jsdom": "^29.1.1",
|
|
36
|
-
"kysely": "
|
|
35
|
+
"kysely": "catalog:",
|
|
37
36
|
"kysely-codegen": "0.19.0",
|
|
38
37
|
"kysely-ctl": "0.20.0",
|
|
39
38
|
"next-auth": "4.24.15",
|
|
40
39
|
"postcss": "^8.5.15",
|
|
41
40
|
"siwe": "2.3.2",
|
|
42
41
|
"tailwindcss": "3.4.19",
|
|
43
|
-
"typescript": "
|
|
44
|
-
"viem": "
|
|
42
|
+
"typescript": "catalog:",
|
|
43
|
+
"viem": "catalog:",
|
|
45
44
|
"vitest": "3.2.6",
|
|
46
45
|
"wagmi": "2.19.5"
|
|
47
|
-
}
|
|
48
|
-
"packageManager": "pnpm@10.34.5"
|
|
46
|
+
}
|
|
49
47
|
}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
# Workspace raíz: una sola instalación, un solo lockfile y versiones compartidas por catálogo.
|
|
2
|
+
#
|
|
3
|
+
# Los motores vendorizados (`packages/generated/*`) son miembros del workspace, así que
|
|
4
|
+
# instalan sus propias dependencias y su puente (`generated-<motor>`) se resuelve solo.
|
|
5
|
+
packages:
|
|
6
|
+
- 'apps/*'
|
|
7
|
+
- 'packages/*'
|
|
8
|
+
- 'packages/generated/*'
|
|
9
|
+
|
|
10
|
+
# Versión única por dependencia: las apps escriben `"catalog:"`.
|
|
11
|
+
catalog:
|
|
12
|
+
# ecosistema y motores
|
|
13
|
+
'@pasosdejesus/m': ^{{m_version}}
|
|
14
|
+
'@pasosdejesus/mpdj': ^0.2.14
|
|
15
|
+
'@pasosdejesus/usdt': ^0.1.3
|
|
16
|
+
# compartidas por apps/web y apps/contracts
|
|
17
|
+
typescript: 5.9.3
|
|
18
|
+
viem: ^2.51.0
|
|
19
|
+
dotenv: ^17.4.2
|
|
20
|
+
# de apps/web, centralizadas igual
|
|
21
|
+
next: ^16.0.0
|
|
22
|
+
react: 19.3.0
|
|
23
|
+
react-dom: 19.3.0
|
|
24
|
+
kysely: 0.28.17
|
|
25
|
+
kysely-postgres-js: 3.0.0
|
|
26
|
+
pg: 8.17.2
|
|
27
|
+
|
|
28
|
+
# Paquetes cuyo script de instalación se permite ejecutar (OpenBSD/adJ).
|
|
29
|
+
allowBuilds:
|
|
30
|
+
'@pasosdejesus/m': true
|
|
31
|
+
bufferutil: true
|
|
32
|
+
esbuild: true
|
|
33
|
+
keccak: true
|
|
34
|
+
sharp: true
|
|
35
|
+
utf-8-validate: true
|
|
36
|
+
|
|
37
|
+
# OpenBSD/adJ: variantes WASM (no hay binarios nativos de estos paquetes).
|
|
38
|
+
overrides:
|
|
39
|
+
'@parcel/watcher': npm:@parcel/watcher-wasm
|
|
40
|
+
rollup: npm:@rollup/wasm-node
|
|
41
|
+
lightningcss: npm:lightningcss-wasm
|
|
42
|
+
'@tailwindcss/oxide': npm:@tailwindcss/oxide-wasm32-wasi
|
package/dist/util/engines.d.ts
CHANGED
|
@@ -30,7 +30,7 @@ export declare function loadEnginePackages(pkgFile: string): Promise<void>;
|
|
|
30
30
|
/**
|
|
31
31
|
* Locate the `packages/` directory by searching upward from `startDir`.
|
|
32
32
|
* Mirrors the CLI's hierarchical .env / package.json lookup
|
|
33
|
-
* (apps/
|
|
33
|
+
* (apps/web → apps → project root). Returns null if none found.
|
|
34
34
|
*/
|
|
35
35
|
export declare function findPackagesDir(startDir: string): Promise<string | null>;
|
|
36
36
|
/**
|
package/dist/util/engines.js
CHANGED
|
@@ -77,7 +77,7 @@ export async function loadEnginePackages(pkgFile) {
|
|
|
77
77
|
/**
|
|
78
78
|
* Locate the `packages/` directory by searching upward from `startDir`.
|
|
79
79
|
* Mirrors the CLI's hierarchical .env / package.json lookup
|
|
80
|
-
* (apps/
|
|
80
|
+
* (apps/web → apps → project root). Returns null if none found.
|
|
81
81
|
*/
|
|
82
82
|
export async function findPackagesDir(startDir) {
|
|
83
83
|
let current = startDir;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pasosdejesus/m",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.31.1",
|
|
4
4
|
"description": "Motor para crear y gestionar proyectos al estilo Pasos de Jesus.",
|
|
5
5
|
"author": "",
|
|
6
6
|
"license": "ISC",
|
|
@@ -141,7 +141,7 @@
|
|
|
141
141
|
"picocolors": "^1.1.1"
|
|
142
142
|
},
|
|
143
143
|
"optionalDependencies": {
|
|
144
|
-
"@pasosdejesus/contract-test": "0.1.
|
|
144
|
+
"@pasosdejesus/contract-test": "0.1.5",
|
|
145
145
|
"@pasosdejesus/edr": "0.1.2"
|
|
146
146
|
},
|
|
147
147
|
"devDependencies": {
|
package/src/blockchain/README.md
CHANGED
|
@@ -49,7 +49,7 @@ const usdt = getContractAddress('celo', 'NEXT_PUBLIC_USDT_ADDRESS', deploymentsD
|
|
|
49
49
|
┌──────────────────────────────────────────────────────┐
|
|
50
50
|
│ Project (sivel.xyz / learn.tg) │
|
|
51
51
|
│ │
|
|
52
|
-
│ apps/
|
|
52
|
+
│ apps/contracts/deployments/ │
|
|
53
53
|
│ └── *.json (deployment addresses) │
|
|
54
54
|
│ │
|
|
55
55
|
│ lib/deployments.ts │
|
|
@@ -117,9 +117,9 @@ Components use Tailwind classes. Your project needs Tailwind configured with the
|
|
|
117
117
|
|
|
118
118
|
## Tests
|
|
119
119
|
|
|
120
|
-
Tests for these components are in `tests/test-project/apps/
|
|
120
|
+
Tests for these components are in `tests/test-project/apps/web/tests/shadcn-components/` of the `@pasosdejesus/m` repository. Run with:
|
|
121
121
|
|
|
122
122
|
```bash
|
|
123
|
-
cd tests/test-project/apps/
|
|
123
|
+
cd tests/test-project/apps/web
|
|
124
124
|
make test
|
|
125
125
|
```
|
package/src/wallet/README.md
CHANGED
|
@@ -91,6 +91,21 @@ configureInAppWallet({
|
|
|
91
91
|
`react` es un *optional peer*: el subpath está fuera del barrel, así que importar
|
|
92
92
|
`@pasosdejesus/m/wallet` no arrastra React.
|
|
93
93
|
|
|
94
|
+
## Integración con el host (CSP)
|
|
95
|
+
|
|
96
|
+
La llave privada vive en la página: desbloquear, firmar y mover fondos son JavaScript en el
|
|
97
|
+
origen del host, así que el host **debe** servir una CSP estricta (referencia de implementación:
|
|
98
|
+
`learn.tg/doc/csp.md`). Contrato mínimo que el paquete espera del host:
|
|
99
|
+
|
|
100
|
+
- `script-src` con **nonce por request** (Next inyecta scripts de hidratación) y **sin**
|
|
101
|
+
`'unsafe-eval'` ni `'unsafe-inline'` para scripts.
|
|
102
|
+
- **Sin `worker-src`**: el núcleo **no** crea Web Workers (tampoco usa `eval`/`new Function`).
|
|
103
|
+
- `connect-src`: incluir el RPC que se pase a `getInAppWalletProvider({ rpcUrl })`.
|
|
104
|
+
- `img-src`: incluir los hosts de imágenes que use tu UI (p. ej. NFT/IPFS); `data:` sólo si
|
|
105
|
+
renderizas QR como data-URL.
|
|
106
|
+
- `default-src 'self'` y `frame-ancestors 'none'`.
|
|
107
|
+
- **Origen seguro** (`https:` o `localhost`): lo exigen `crypto.subtle` (WebCrypto) y WebAuthn.
|
|
108
|
+
|
|
94
109
|
## Pruebas
|
|
95
110
|
|
|
96
111
|
Mocks en `@pasosdejesus/m/test-utils` (`installLocalStorage`, `installIndexedDB`,
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
allowBuilds:
|
|
2
|
-
'@pasosdejesus/m': true
|
|
3
|
-
bufferutil: true
|
|
4
|
-
esbuild: true
|
|
5
|
-
keccak: true
|
|
6
|
-
sharp: true
|
|
7
|
-
utf-8-validate: true
|
|
8
|
-
|
|
9
|
-
overrides:
|
|
10
|
-
'@parcel/watcher': npm:@parcel/watcher-wasm
|
|
11
|
-
rollup: npm:@rollup/wasm-node
|
|
12
|
-
lightningcss: npm:lightningcss-wasm
|
|
13
|
-
'@tailwindcss/oxide': npm:@tailwindcss/oxide-wasm32-wasi
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|