@pasosdejesus/m 0.15.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/dist/blockchain/deployments.d.ts +40 -0
- package/dist/blockchain/deployments.d.ts.map +1 -0
- package/dist/blockchain/deployments.js +64 -0
- package/dist/debug/DebugConsole.d.ts +22 -0
- package/dist/debug/DebugConsole.d.ts.map +1 -0
- package/dist/debug/DebugConsole.js +79 -0
- package/dist/debug/Logger.d.ts +38 -0
- package/dist/debug/Logger.d.ts.map +1 -0
- package/dist/debug/Logger.js +94 -0
- package/dist/debug/index.d.ts +6 -0
- package/dist/debug/index.d.ts.map +1 -0
- package/dist/debug/index.js +4 -0
- package/dist/debug/useLogger.d.ts +14 -0
- package/dist/debug/useLogger.d.ts.map +1 -0
- package/dist/debug/useLogger.js +23 -0
- package/dist/debug/utils.d.ts +10 -0
- package/dist/debug/utils.d.ts.map +1 -0
- package/dist/debug/utils.js +53 -0
- package/dist/e2e/assertions.d.ts +5 -0
- package/dist/e2e/assertions.d.ts.map +1 -0
- package/dist/e2e/assertions.js +18 -0
- package/dist/e2e/browser.d.ts +37 -0
- package/dist/e2e/browser.d.ts.map +1 -0
- package/dist/e2e/browser.js +97 -0
- package/dist/e2e/env.d.ts +18 -0
- package/dist/e2e/env.d.ts.map +1 -0
- package/dist/e2e/env.js +57 -0
- package/dist/e2e/index.d.ts +11 -0
- package/dist/e2e/index.d.ts.map +1 -0
- package/dist/e2e/index.js +8 -0
- package/dist/e2e/navigation.d.ts +4 -0
- package/dist/e2e/navigation.d.ts.map +1 -0
- package/dist/e2e/navigation.js +32 -0
- package/dist/e2e/siwe-mock.d.ts +11 -0
- package/dist/e2e/siwe-mock.d.ts.map +1 -0
- package/dist/e2e/siwe-mock.js +112 -0
- package/dist/e2e/siwe.d.ts +15 -0
- package/dist/e2e/siwe.d.ts.map +1 -0
- package/dist/e2e/siwe.js +85 -0
- package/dist/e2e/wallet-mock.d.ts +13 -0
- package/dist/e2e/wallet-mock.d.ts.map +1 -0
- package/dist/e2e/wallet-mock.js +91 -0
- package/dist/i18n/common-cli.d.ts +11 -0
- package/dist/i18n/common-cli.d.ts.map +1 -0
- package/dist/i18n/common-cli.js +22 -0
- package/dist/i18n/createTranslator.d.ts +28 -0
- package/dist/i18n/createTranslator.d.ts.map +1 -0
- package/dist/i18n/createTranslator.js +48 -0
- package/dist/i18n/index.d.ts +4 -0
- package/dist/i18n/index.d.ts.map +1 -0
- package/dist/i18n/index.js +2 -0
- package/dist/i18n/locales/cli.d.ts +3 -0
- package/dist/i18n/locales/cli.d.ts.map +1 -0
- package/dist/i18n/locales/cli.js +180 -0
- package/dist/i18n/types.d.ts +3 -0
- package/dist/i18n/types.d.ts.map +1 -0
- package/dist/i18n/types.js +1 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +15 -0
- package/dist/index.test.d.ts +2 -0
- package/dist/index.test.d.ts.map +1 -0
- package/dist/index.test.js +10 -0
- package/dist/m.d.ts +2 -0
- package/dist/m.d.ts.map +1 -0
- package/dist/m.js +334 -0
- package/dist/plugin.d.ts +10 -0
- package/dist/plugin.d.ts.map +1 -0
- package/dist/plugin.js +7 -0
- package/dist/shadcn_components/cn.d.ts +13 -0
- package/dist/shadcn_components/cn.d.ts.map +1 -0
- package/dist/shadcn_components/cn.js +15 -0
- package/dist/shadcn_components/ui/accordion.d.ts +8 -0
- package/dist/shadcn_components/ui/accordion.d.ts.map +1 -0
- package/dist/shadcn_components/ui/accordion.js +14 -0
- package/dist/shadcn_components/ui/alert-dialog.d.ts +21 -0
- package/dist/shadcn_components/ui/alert-dialog.d.ts.map +1 -0
- package/dist/shadcn_components/ui/alert-dialog.js +27 -0
- package/dist/shadcn_components/ui/alert.d.ts +9 -0
- package/dist/shadcn_components/ui/alert.d.ts.map +1 -0
- package/dist/shadcn_components/ui/alert.js +22 -0
- package/dist/shadcn_components/ui/avatar.d.ts +7 -0
- package/dist/shadcn_components/ui/avatar.d.ts.map +1 -0
- package/dist/shadcn_components/ui/avatar.js +12 -0
- package/dist/shadcn_components/ui/badge.d.ts +10 -0
- package/dist/shadcn_components/ui/badge.d.ts.map +1 -0
- package/dist/shadcn_components/ui/badge.js +22 -0
- package/dist/shadcn_components/ui/button.d.ts +11 -0
- package/dist/shadcn_components/ui/button.d.ts.map +1 -0
- package/dist/shadcn_components/ui/button.js +31 -0
- package/dist/shadcn_components/ui/card.d.ts +10 -0
- package/dist/shadcn_components/ui/card.d.ts.map +1 -0
- package/dist/shadcn_components/ui/card.js +24 -0
- package/dist/shadcn_components/ui/checkbox.d.ts +5 -0
- package/dist/shadcn_components/ui/checkbox.d.ts.map +1 -0
- package/dist/shadcn_components/ui/checkbox.js +9 -0
- package/dist/shadcn_components/ui/dialog.d.ts +20 -0
- package/dist/shadcn_components/ui/dialog.d.ts.map +1 -0
- package/dist/shadcn_components/ui/dialog.js +23 -0
- package/dist/shadcn_components/ui/dropdown-menu.d.ts +28 -0
- package/dist/shadcn_components/ui/dropdown-menu.d.ts.map +1 -0
- package/dist/shadcn_components/ui/dropdown-menu.js +36 -0
- package/dist/shadcn_components/ui/form.d.ts +24 -0
- package/dist/shadcn_components/ui/form.d.ts.map +1 -0
- package/dist/shadcn_components/ui/form.js +63 -0
- package/dist/shadcn_components/ui/input.d.ts +4 -0
- package/dist/shadcn_components/ui/input.d.ts.map +1 -0
- package/dist/shadcn_components/ui/input.js +6 -0
- package/dist/shadcn_components/ui/label.d.ts +6 -0
- package/dist/shadcn_components/ui/label.d.ts.map +1 -0
- package/dist/shadcn_components/ui/label.js +10 -0
- package/dist/shadcn_components/ui/menubar.d.ts +29 -0
- package/dist/shadcn_components/ui/menubar.d.ts.map +1 -0
- package/dist/shadcn_components/ui/menubar.js +46 -0
- package/dist/shadcn_components/ui/popover.d.ts +7 -0
- package/dist/shadcn_components/ui/popover.d.ts.map +1 -0
- package/dist/shadcn_components/ui/popover.js +10 -0
- package/dist/shadcn_components/ui/progress.d.ts +5 -0
- package/dist/shadcn_components/ui/progress.d.ts.map +1 -0
- package/dist/shadcn_components/ui/progress.js +8 -0
- package/dist/shadcn_components/ui/radio-group.d.ts +6 -0
- package/dist/shadcn_components/ui/radio-group.d.ts.map +1 -0
- package/dist/shadcn_components/ui/radio-group.js +15 -0
- package/dist/shadcn_components/ui/scroll-area.d.ts +6 -0
- package/dist/shadcn_components/ui/scroll-area.d.ts.map +1 -0
- package/dist/shadcn_components/ui/scroll-area.js +12 -0
- package/dist/shadcn_components/ui/select.d.ts +14 -0
- package/dist/shadcn_components/ui/select.d.ts.map +1 -0
- package/dist/shadcn_components/ui/select.js +27 -0
- package/dist/shadcn_components/ui/separator.d.ts +5 -0
- package/dist/shadcn_components/ui/separator.d.ts.map +1 -0
- package/dist/shadcn_components/ui/separator.js +8 -0
- package/dist/shadcn_components/ui/sheet.d.ts +26 -0
- package/dist/shadcn_components/ui/sheet.d.ts.map +1 -0
- package/dist/shadcn_components/ui/sheet.js +37 -0
- package/dist/shadcn_components/ui/skeleton.d.ts +3 -0
- package/dist/shadcn_components/ui/skeleton.d.ts.map +1 -0
- package/dist/shadcn_components/ui/skeleton.js +6 -0
- package/dist/shadcn_components/ui/slider.d.ts +5 -0
- package/dist/shadcn_components/ui/slider.d.ts.map +1 -0
- package/dist/shadcn_components/ui/slider.js +8 -0
- package/dist/shadcn_components/ui/switch.d.ts +5 -0
- package/dist/shadcn_components/ui/switch.d.ts.map +1 -0
- package/dist/shadcn_components/ui/switch.js +8 -0
- package/dist/shadcn_components/ui/table.d.ts +11 -0
- package/dist/shadcn_components/ui/table.d.ts.map +1 -0
- package/dist/shadcn_components/ui/table.js +20 -0
- package/dist/shadcn_components/ui/tabs.d.ts +8 -0
- package/dist/shadcn_components/ui/tabs.d.ts.map +1 -0
- package/dist/shadcn_components/ui/tabs.js +13 -0
- package/dist/shadcn_components/ui/textarea.d.ts +4 -0
- package/dist/shadcn_components/ui/textarea.d.ts.map +1 -0
- package/dist/shadcn_components/ui/textarea.js +8 -0
- package/dist/shadcn_components/ui/toast.d.ts +16 -0
- package/dist/shadcn_components/ui/toast.d.ts.map +1 -0
- package/dist/shadcn_components/ui/toast.js +34 -0
- package/dist/shadcn_components/ui/toaster.d.ts +2 -0
- package/dist/shadcn_components/ui/toaster.d.ts.map +1 -0
- package/dist/shadcn_components/ui/toaster.js +10 -0
- package/dist/shadcn_components/ui/tooltip.d.ts +8 -0
- package/dist/shadcn_components/ui/tooltip.d.ts.map +1 -0
- package/dist/shadcn_components/ui/tooltip.js +11 -0
- package/dist/shadcn_components/ui/use-toast.d.ts +45 -0
- package/dist/shadcn_components/ui/use-toast.d.ts.map +1 -0
- package/dist/shadcn_components/ui/use-toast.js +126 -0
- package/dist/tasks/context.d.ts +13 -0
- package/dist/tasks/context.d.ts.map +1 -0
- package/dist/tasks/context.js +310 -0
- package/dist/tasks/create.d.ts +2 -0
- package/dist/tasks/create.d.ts.map +1 -0
- package/dist/tasks/create.js +91 -0
- package/dist/tasks/db.d.ts +19 -0
- package/dist/tasks/db.d.ts.map +1 -0
- package/dist/tasks/db.js +791 -0
- package/dist/tasks/e2e.d.ts +2 -0
- package/dist/tasks/e2e.d.ts.map +1 -0
- package/dist/tasks/e2e.js +124 -0
- package/dist/tasks/edit.d.ts +7 -0
- package/dist/tasks/edit.d.ts.map +1 -0
- package/dist/tasks/edit.js +471 -0
- package/dist/tasks/engine.d.ts +2 -0
- package/dist/tasks/engine.d.ts.map +1 -0
- package/dist/tasks/engine.js +149 -0
- package/dist/tasks/env-diff.d.ts +2 -0
- package/dist/tasks/env-diff.d.ts.map +1 -0
- package/dist/tasks/env-diff.js +140 -0
- package/dist/tasks/fuzzy.d.ts +9 -0
- package/dist/tasks/fuzzy.d.ts.map +1 -0
- package/dist/tasks/fuzzy.js +153 -0
- package/dist/tasks/glob.d.ts +5 -0
- package/dist/tasks/glob.d.ts.map +1 -0
- package/dist/tasks/glob.js +57 -0
- package/dist/tasks/grep.d.ts +9 -0
- package/dist/tasks/grep.d.ts.map +1 -0
- package/dist/tasks/grep.js +93 -0
- package/dist/tasks/readfile.d.ts +2 -0
- package/dist/tasks/readfile.d.ts.map +1 -0
- package/dist/tasks/readfile.js +177 -0
- package/dist/tasks/update.d.ts +5 -0
- package/dist/tasks/update.d.ts.map +1 -0
- package/dist/tasks/update.js +200 -0
- package/dist/tasks/util.d.ts +12 -0
- package/dist/tasks/util.d.ts.map +1 -0
- package/dist/tasks/util.js +42 -0
- package/dist/tasks/wallet.d.ts +2 -0
- package/dist/tasks/wallet.d.ts.map +1 -0
- package/dist/tasks/wallet.js +697 -0
- package/dist/tasks/writefile.d.ts +2 -0
- package/dist/tasks/writefile.d.ts.map +1 -0
- package/dist/tasks/writefile.js +66 -0
- package/dist/templates/AGENTS.md.hbs +81 -0
- package/dist/templates/ARCHITECTURE.md.hbs +146 -0
- package/dist/templates/CONTRIBUTING.md.hbs +83 -0
- package/dist/templates/LICENCIA.md +21 -0
- package/dist/templates/LICENSE.md +15 -0
- package/dist/templates/Makefile +16 -0
- package/dist/templates/README.md.hbs +111 -0
- package/dist/templates/apps/.env.example.hbs +75 -0
- package/dist/templates/apps/hardhat/.prettierrc +16 -0
- package/dist/templates/apps/hardhat/MOCK_USDT_README.md +20 -0
- package/dist/templates/apps/hardhat/Makefile +13 -0
- package/dist/templates/apps/hardhat/README.md +129 -0
- package/dist/templates/apps/hardhat/bin/MusdtVerification +4 -0
- package/dist/templates/apps/hardhat/bin/approveDepositOwner +7 -0
- package/dist/templates/apps/hardhat/bin/contractVerification +9 -0
- package/dist/templates/apps/hardhat/bin/deployMockUSDT +7 -0
- package/dist/templates/apps/hardhat/bin/prepadJ.sh +14 -0
- package/dist/templates/apps/hardhat/bin/verifyMockUSDT +7 -0
- package/dist/templates/apps/hardhat/contracts/MockUSDT.sol +47 -0
- package/dist/templates/apps/hardhat/hardhat.config.ts +102 -0
- package/dist/templates/apps/hardhat/package.json +55 -0
- package/dist/templates/apps/hardhat/scripts/approveDepositOwner.ts +22 -0
- package/dist/templates/apps/hardhat/scripts/deployMockUSDT.ts +49 -0
- package/dist/templates/apps/hardhat/scripts/verifyDeployment.ts +93 -0
- package/dist/templates/apps/hardhat/scripts/verifyMockUSDT.ts +52 -0
- package/dist/templates/apps/hardhat/sync-abis.mjs +58 -0
- package/dist/templates/apps/hardhat/test/MockUSDT.test.ts +40 -0
- package/dist/templates/apps/hardhat/tsconfig.json +27 -0
- package/dist/templates/apps/nextjs/.config/kysely.config.ts +36 -0
- package/dist/templates/apps/nextjs/Makefile +24 -0
- package/dist/templates/apps/nextjs/README.md.hbs +76 -0
- package/dist/templates/apps/nextjs/abis/IERC20.json +74 -0
- package/dist/templates/apps/nextjs/abis/MockUSDT.json +242 -0
- package/dist/templates/apps/nextjs/abis/ReentrancyGuard.json +1 -0
- package/dist/templates/apps/nextjs/app/globals.css +3 -0
- package/dist/templates/apps/nextjs/app/layout.tsx.hbs +26 -0
- package/dist/templates/apps/nextjs/app/page.tsx.hbs +225 -0
- package/dist/templates/apps/nextjs/app/testui/page.tsx +371 -0
- package/dist/templates/apps/nextjs/bin/m +8 -0
- package/dist/templates/apps/nextjs/components.json +21 -0
- package/dist/templates/apps/nextjs/next-env.d.ts +5 -0
- package/dist/templates/apps/nextjs/next.config.ts +10 -0
- package/dist/templates/apps/nextjs/package.json.hbs +48 -0
- package/dist/templates/apps/nextjs/pnpm-workspace.yaml +13 -0
- package/dist/templates/apps/nextjs/postcss.config.mjs +6 -0
- package/dist/templates/apps/nextjs/tailwind.config.js +11 -0
- package/dist/templates/apps/nextjs/tests/helpers.ts +31 -0
- package/dist/templates/apps/nextjs/tests/index.test.ts +7 -0
- package/dist/templates/apps/nextjs/tests/setup-env.ts.hbs +8 -0
- package/dist/templates/apps/nextjs/tests/test-utils.example.test.ts +168 -0
- package/dist/templates/apps/nextjs/tsconfig.json +44 -0
- package/dist/templates/apps/nextjs/tsconfig.test.json +38 -0
- package/dist/templates/apps/nextjs/vitest.config.ts +13 -0
- package/dist/test-utils/fs-mocks.d.ts +32 -0
- package/dist/test-utils/fs-mocks.d.ts.map +1 -0
- package/dist/test-utils/fs-mocks.js +63 -0
- package/dist/test-utils/i18n-mock.d.ts +21 -0
- package/dist/test-utils/i18n-mock.d.ts.map +1 -0
- package/dist/test-utils/i18n-mock.js +29 -0
- package/dist/test-utils/index.d.ts +12 -0
- package/dist/test-utils/index.d.ts.map +1 -0
- package/dist/test-utils/index.js +11 -0
- package/dist/test-utils/kysely-mocks.d.ts +298 -0
- package/dist/test-utils/kysely-mocks.d.ts.map +1 -0
- package/dist/test-utils/kysely-mocks.js +173 -0
- package/dist/test-utils/radix-mocks.d.ts +134 -0
- package/dist/test-utils/radix-mocks.d.ts.map +1 -0
- package/dist/test-utils/radix-mocks.js +175 -0
- package/dist/test-utils/rainbowkit-mocks.d.ts +80 -0
- package/dist/test-utils/rainbowkit-mocks.d.ts.map +1 -0
- package/dist/test-utils/rainbowkit-mocks.js +247 -0
- package/dist/test-utils/viem-mocks.d.ts +86 -0
- package/dist/test-utils/viem-mocks.d.ts.map +1 -0
- package/dist/test-utils/viem-mocks.js +54 -0
- package/dist/util/cli-parser.d.ts +20 -0
- package/dist/util/cli-parser.d.ts.map +1 -0
- package/dist/util/cli-parser.js +38 -0
- package/dist/util/colors.d.ts +5 -0
- package/dist/util/colors.d.ts.map +1 -0
- package/dist/util/colors.js +5 -0
- package/dist/util/locale.d.ts +3 -0
- package/dist/util/locale.d.ts.map +1 -0
- package/dist/util/locale.js +10 -0
- package/dist/wba/client.d.ts +19 -0
- package/dist/wba/client.d.ts.map +1 -0
- package/dist/wba/client.js +31 -0
- package/dist/wba/index.d.ts +4 -0
- package/dist/wba/index.d.ts.map +1 -0
- package/dist/wba/index.js +2 -0
- package/dist/wba/routes/event.d.ts +32 -0
- package/dist/wba/routes/event.d.ts.map +1 -0
- package/dist/wba/routes/event.js +42 -0
- package/dist/wba/routes/index.d.ts +3 -0
- package/dist/wba/routes/index.d.ts.map +1 -0
- package/dist/wba/routes/index.js +2 -0
- package/dist/wba/routes/summary.d.ts +44 -0
- package/dist/wba/routes/summary.d.ts.map +1 -0
- package/dist/wba/routes/summary.js +146 -0
- package/dist/wba/server.d.ts +18 -0
- package/dist/wba/server.d.ts.map +1 -0
- package/dist/wba/server.js +29 -0
- package/dist/wba/types.d.ts +68 -0
- package/dist/wba/types.d.ts.map +1 -0
- package/dist/wba/types.js +6 -0
- package/package.json +223 -0
- package/src/blockchain/README.md +80 -0
- package/src/debug/README.md +94 -0
- package/src/e2e/README.md +105 -0
- package/src/i18n/README.md +143 -0
- package/src/shadcn_components/README.md +125 -0
- package/src/tasks/README.md +69 -0
- package/src/test-utils/README.md +638 -0
- package/src/util/README.md +18 -0
- package/src/wba/README.md +175 -0
|
@@ -0,0 +1,180 @@
|
|
|
1
|
+
export const cliTranslations = {
|
|
2
|
+
en: {
|
|
3
|
+
'cmd.db_create_description': 'Creates the database',
|
|
4
|
+
'cmd.db_drop_description': 'Drops the database',
|
|
5
|
+
'cmd.db_super_createuser_description': 'Creates a superuser for the database',
|
|
6
|
+
'cmd.db_structure_dump_description': 'Dumps the database structure',
|
|
7
|
+
'cmd.db_structure_load_description': 'Loads the database structure',
|
|
8
|
+
'cmd.db_migrate_description': 'Runs database migrations',
|
|
9
|
+
'cmd.db_mig_make_description': 'Creates a new migration file',
|
|
10
|
+
'cmd.rollback_description': 'Rolls back the last migration (--step N to revert N)',
|
|
11
|
+
'cmd.db_rollback_description': 'Rolls back the last migration (--step N to revert N)',
|
|
12
|
+
'cmd.db_seed_description': 'Seeds the database',
|
|
13
|
+
'cmd.db_check_description': 'Checks expected database schemas',
|
|
14
|
+
'cmd.db_console_description': 'Opens a database console',
|
|
15
|
+
'cmd.db_test_connection_description': 'Tests the database connection non-interactively',
|
|
16
|
+
'cmd.db_dump_description': 'Dumps the database (data + schema) to db/backups/',
|
|
17
|
+
'cmd.db_restore_description': 'Restores the database from a backup in db/backups/',
|
|
18
|
+
'cmd.contract_compile_description': 'Compiles Smart Contracts in apps/hardhat',
|
|
19
|
+
'cmd.contract_test_description': 'Runs Smart Contract tests in apps/hardhat',
|
|
20
|
+
'cmd.contract_node_description': 'Runs a local Hardhat node',
|
|
21
|
+
'cmd.contract_deploy_description': 'Deploys Smart Contracts',
|
|
22
|
+
'cmd.create_description': 'Creates a new project',
|
|
23
|
+
'cmd.update_description': 'Synchronizes the current project with template improvements (interactive)',
|
|
24
|
+
'cmd.ai_framework_description': 'Shows a manifest of christian alignment (randomly chosen)',
|
|
25
|
+
'cmd.ai_verify_description': 'Generates a christological verification question',
|
|
26
|
+
'cmd.ai_verify_answer_description': 'Responds to the christological verification question',
|
|
27
|
+
'cmd.ai_context_description': 'Generates project context for AI chat (DeepSeek compatible)',
|
|
28
|
+
'cmd.ai_apply_description': 'Applies changes from clipboard (DeepSeek diff format)',
|
|
29
|
+
'cmd.ai_readfile_description': 'Displays file content (similar to Claude Code read_file)',
|
|
30
|
+
'cmd.ai_writefile_description': 'Creates or replaces a file with clipboard content',
|
|
31
|
+
'cmd.ai_grep_description': 'Searches for text in files (grep)',
|
|
32
|
+
'cmd.ai_skill_description': 'Shows SKILL.md and copies it to the clipboard',
|
|
33
|
+
'cmd.ai_glob_description': 'Searches for files by pattern (glob)',
|
|
34
|
+
'cmd.ai_principles_description': 'Shows the 4 guiding principles of the project (Amor, Respeto, Humildad, Hacer sin Excusas)',
|
|
35
|
+
'cmd.env_diff_description': 'Compares .env.example vs .env showing missing, extra, and changed variables',
|
|
36
|
+
'cmd.req_list_description': 'Lists requirements from REQ/ with status and cross-project',
|
|
37
|
+
'cmd.req_show_description': 'Shows a requirement from REQ/',
|
|
38
|
+
'cmd.req_cross_description': 'Lists requirements with cross-project impact',
|
|
39
|
+
'cmd.req_compare_description': 'Compares local REQ with remote issue (GitLab/GitHub)',
|
|
40
|
+
'cmd.req_sync_from_repo_description': 'Updates local REQ from remote issue',
|
|
41
|
+
'cmd.req_sync_to_repo_description': 'Updates remote issue from local REQ',
|
|
42
|
+
'cmd.req_list_repo_description': 'Lists open issues from the remote repository',
|
|
43
|
+
'cmd.req_create_description': 'Creates a new remote issue and local REQ (repo assigns IID)',
|
|
44
|
+
'cmd.req_close_description': 'Closes a requirement: sync to repo, close issue, delete local',
|
|
45
|
+
'cmd.credentials_description': 'PasosDeJesusCredentials administration commands',
|
|
46
|
+
'cmd.credentials_list_types_description': 'List credential types from contract',
|
|
47
|
+
'cmd.credentials_mint_description': 'Mint a credential to a wallet',
|
|
48
|
+
'cmd.credentials_register_type_description': 'Register a new credential type',
|
|
49
|
+
'cmd.credentials_recompose_image_description': 'Recompose credential image from cache',
|
|
50
|
+
'cmd.credentials_set_max_supply_description': 'Set max supply for a credential type',
|
|
51
|
+
'cmd.credentials_set_site_uri_description': 'Set base URI for a site',
|
|
52
|
+
'cmd.credentials_sync_cache_description': 'Sync credential_metadata cache from contract',
|
|
53
|
+
'cmd.credentials_revoke_credential_description': 'Revoke a credential from a wallet',
|
|
54
|
+
'cmd.credentials_grant_minter_description': 'Grant MINTER_ROLE to a wallet',
|
|
55
|
+
'cmd.credentials_revoke_minter_description': 'Revoke MINTER_ROLE from a wallet',
|
|
56
|
+
'cmd.ai_writefile_usage': 'Usage: m ai:writefile <file>',
|
|
57
|
+
'cmd.ai_grep_usage': 'Usage: m ai:grep <pattern> [path] [type]',
|
|
58
|
+
'cmd.ai_glob_usage': 'Usage: m ai:glob <pattern> [--path <path>] [--ignore <pattern>]',
|
|
59
|
+
'cmd.m_create_usage': 'Usage: m m:create <name> [description]',
|
|
60
|
+
'usage_line': 'Usage: m [options] [command]',
|
|
61
|
+
'cmd.options_header': 'Options:',
|
|
62
|
+
'cmd.commands_header': 'Commands:',
|
|
63
|
+
'cmd.version_description': 'output the version number',
|
|
64
|
+
'cmd.help_description': 'display help for command',
|
|
65
|
+
'cmd.command_not_found': 'Command not found: {{0}}',
|
|
66
|
+
'cmd.argument_required': 'Argument required for command: {{0}}',
|
|
67
|
+
'cmd.program_description': 'A modern CLI for msip projects',
|
|
68
|
+
'cmd.wallet_generate_description': 'Generate a new wallet with mnemonic',
|
|
69
|
+
'cmd.wallet_approve_description': 'Approve ERC20 token spending',
|
|
70
|
+
'cmd.wallet_list_description': 'List stored wallets',
|
|
71
|
+
'cmd.wallet_import_description': 'Import a wallet from mnemonic or private key',
|
|
72
|
+
'cmd.wallet_sign_description': 'Sign a transaction offline (airgapped)',
|
|
73
|
+
'cmd.wallet_send_description': 'Send native or ERC20 tokens',
|
|
74
|
+
'cmd.wallet_balance_description': 'Check wallet balance',
|
|
75
|
+
'cmd.wallet_derive_description': 'Derive a child wallet from mnemonic',
|
|
76
|
+
'cmd.wallet_call_description': 'Read data from a smart contract',
|
|
77
|
+
'cmd.eng_wba_description': 'Install WBA engine',
|
|
78
|
+
'cmd.eng_wba_setup_description': 'Create WBA migration files',
|
|
79
|
+
'cmd.eng_credentials_description': 'Install credentials engine',
|
|
80
|
+
'cmd.eng_credentials_setup_description': 'Create credential migration files',
|
|
81
|
+
'cmd.eng_list_description': 'List available engines',
|
|
82
|
+
'cmd.eng_check_description': 'Verify engine schemas',
|
|
83
|
+
'cmd.wallet_broadcast_description': 'Broadcast a signed transaction',
|
|
84
|
+
'cmd.wallet_keccak_description': 'Compute Keccak-256 hash of a string',
|
|
85
|
+
'cmd.create_arg_name': 'project name',
|
|
86
|
+
'cmd.create_arg_description': 'project description',
|
|
87
|
+
'cmd.create_arg_required': 'Project name is required',
|
|
88
|
+
'cmd.db_mig_make_missing_arg': 'Migration name is required',
|
|
89
|
+
'cmd.e2e_description': 'Run E2E tests (specs with Puppeteer, smoke with axios). Optional: path pattern, --smoke, --grep <filter>',
|
|
90
|
+
},
|
|
91
|
+
es: {
|
|
92
|
+
'cmd.db_create_description': 'Crea la base de datos',
|
|
93
|
+
'cmd.db_drop_description': 'Elimina la base de datos',
|
|
94
|
+
'cmd.db_super_createuser_description': 'Crea un superusuario para la base de datos',
|
|
95
|
+
'cmd.db_structure_dump_description': 'Vuelca la estructura de la base de datos',
|
|
96
|
+
'cmd.db_structure_load_description': 'Carga la estructura de la base de datos',
|
|
97
|
+
'cmd.db_migrate_description': 'Ejecuta las migraciones de la base de datos',
|
|
98
|
+
'cmd.db_mig_make_description': 'Crea un nuevo archivo de migración',
|
|
99
|
+
'cmd.rollback_description': 'Revierte la última migración (--step N para revertir N)',
|
|
100
|
+
'cmd.db_rollback_description': 'Revierte la última migración (--step N para revertir N)',
|
|
101
|
+
'cmd.db_seed_description': 'Siembra la base de datos',
|
|
102
|
+
'cmd.db_check_description': 'Verifica esquemas esperados de base de datos',
|
|
103
|
+
'cmd.db_console_description': 'Abre una consola de base de datos',
|
|
104
|
+
'cmd.db_test_connection_description': 'Prueba la conexión a la base de datos de forma no interactiva',
|
|
105
|
+
'cmd.db_dump_description': 'Respaldar la base de datos (datos + esquema) en db/backups/',
|
|
106
|
+
'cmd.db_restore_description': 'Restaurar la base de datos desde un respaldo en db/backups/',
|
|
107
|
+
'cmd.contract_compile_description': 'Compila los Contratos Inteligentes en apps/hardhat',
|
|
108
|
+
'cmd.contract_test_description': 'Ejecuta las pruebas de los Contratos Inteligentes en apps/hardhat',
|
|
109
|
+
'cmd.contract_node_description': 'Ejecuta un nodo local de Hardhat',
|
|
110
|
+
'cmd.contract_deploy_description': 'Despliega los Contratos Inteligentes',
|
|
111
|
+
'cmd.create_description': 'Crea un nuevo proyecto',
|
|
112
|
+
'cmd.update_description': 'Sincroniza el proyecto actual con las mejoras de las plantillas (interactivo)',
|
|
113
|
+
'cmd.ai_framework_description': 'Muestra un manifiesto de alineación cristiana (aleatorio)',
|
|
114
|
+
'cmd.ai_verify_description': 'Genera una pregunta de verificación cristológica',
|
|
115
|
+
'cmd.ai_verify_answer_description': 'Responde a la pregunta de verificación cristológica',
|
|
116
|
+
'cmd.ai_context_description': 'Genera contexto del proyecto para chat IA (compatible con DeepSeek)',
|
|
117
|
+
'cmd.ai_apply_description': 'Aplica cambios desde el portapapeles (formato diff de DeepSeek)',
|
|
118
|
+
'cmd.ai_readfile_description': 'Muestra contenido de archivos (como read_file de Claude Code)',
|
|
119
|
+
'cmd.ai_writefile_description': 'Crea o reemplaza un archivo con el contenido del portapapeles',
|
|
120
|
+
'cmd.ai_grep_description': 'Busca texto en archivos (grep)',
|
|
121
|
+
'cmd.ai_skill_description': 'Muestra SKILL.md y lo copia al portapapeles',
|
|
122
|
+
'cmd.ai_glob_description': 'Busca archivos por patrón (glob)',
|
|
123
|
+
'cmd.ai_principles_description': 'Muestra los 4 principios rectores del proyecto (Amor, Respeto, Humildad, Hacer sin Excusas)',
|
|
124
|
+
'cmd.env_diff_description': 'Compara .env.example vs .env mostrando variables faltantes, sobrantes y diferentes',
|
|
125
|
+
'cmd.req_list_description': 'Lista requerimientos de REQ/ con estado y cross-project',
|
|
126
|
+
'cmd.req_show_description': 'Muestra un requerimiento de REQ/',
|
|
127
|
+
'cmd.req_cross_description': 'Lista requerimientos con impacto cross-project',
|
|
128
|
+
'cmd.req_compare_description': 'Compara REQ local con issue remoto (GitLab/GitHub)',
|
|
129
|
+
'cmd.req_sync_from_repo_description': 'Actualiza REQ local desde issue remoto',
|
|
130
|
+
'cmd.req_sync_to_repo_description': 'Actualiza issue remoto desde REQ local',
|
|
131
|
+
'cmd.req_list_repo_description': 'Lista issues abiertos del repositorio remoto',
|
|
132
|
+
'cmd.req_create_description': 'Crea nuevo issue remoto y REQ local (repo asigna IID)',
|
|
133
|
+
'cmd.req_close_description': 'Cierra un requerimiento: sync→repo, cierra issue, elimina local',
|
|
134
|
+
'cmd.credentials_description': 'Órdenes de administración de PasosDeJesusCredentials',
|
|
135
|
+
'cmd.credentials_list_types_description': 'Lista tipos de credencial del contrato',
|
|
136
|
+
'cmd.credentials_mint_description': 'Acuña una credencial a una billetera',
|
|
137
|
+
'cmd.credentials_register_type_description': 'Registra un nuevo tipo de credencial',
|
|
138
|
+
'cmd.credentials_recompose_image_description': 'Recompone imagen de credencial desde caché',
|
|
139
|
+
'cmd.credentials_set_max_supply_description': 'Establece suministro máximo para un tipo',
|
|
140
|
+
'cmd.credentials_set_site_uri_description': 'Establece URI base para un sitio',
|
|
141
|
+
'cmd.credentials_sync_cache_description': 'Sincroniza caché credential_metadata desde el contrato',
|
|
142
|
+
'cmd.credentials_revoke_credential_description': 'Revoca una credencial de una billetera',
|
|
143
|
+
'cmd.credentials_grant_minter_description': 'Otorga MINTER_ROLE a una billetera',
|
|
144
|
+
'cmd.credentials_revoke_minter_description': 'Revoca MINTER_ROLE de una billetera',
|
|
145
|
+
'cmd.ai_writefile_usage': 'Uso: m ai:writefile <archivo>',
|
|
146
|
+
'cmd.ai_grep_usage': 'Uso: m ai:grep <patrón> [ruta] [tipo]',
|
|
147
|
+
'cmd.ai_glob_usage': 'Uso: m ai:glob <patrón> [--path <ruta>] [--ignore <patrón>]',
|
|
148
|
+
'cmd.m_create_usage': 'Uso: m m:create <nombre> [descripción]',
|
|
149
|
+
'usage_line': 'Uso: m [opciones] [orden]',
|
|
150
|
+
'cmd.options_header': 'Opciones:',
|
|
151
|
+
'cmd.commands_header': 'Órdenes:',
|
|
152
|
+
'cmd.version_description': 'muestra el número de versión',
|
|
153
|
+
'cmd.help_description': 'muestra la ayuda para la orden',
|
|
154
|
+
'cmd.command_not_found': 'Orden no encontrada: {{0}}',
|
|
155
|
+
'cmd.argument_required': 'Argumento requerido para la orden: {{0}}',
|
|
156
|
+
'cmd.program_description': 'Un CLI moderno para proyectos msip',
|
|
157
|
+
'cmd.wallet_generate_description': 'Genera una nueva billetera con mnemotécnico',
|
|
158
|
+
'cmd.wallet_approve_description': 'Aprueba gasto de token ERC20',
|
|
159
|
+
'cmd.wallet_list_description': 'Lista billeteras almacenadas',
|
|
160
|
+
'cmd.wallet_import_description': 'Importa una billetera desde mnemotécnico o clave privada',
|
|
161
|
+
'cmd.wallet_sign_description': 'Firma una transacción offline (airgapped)',
|
|
162
|
+
'cmd.wallet_send_description': 'Envía tokens nativos o ERC20',
|
|
163
|
+
'cmd.wallet_balance_description': 'Consulta saldo de billetera',
|
|
164
|
+
'cmd.wallet_derive_description': 'Deriva billetera hija desde mnemotécnico',
|
|
165
|
+
'cmd.wallet_call_description': 'Lee datos de un contrato inteligente',
|
|
166
|
+
'cmd.eng_wba_description': 'Instala motor WBA',
|
|
167
|
+
'cmd.eng_wba_setup_description': 'Crea archivos de migración WBA',
|
|
168
|
+
'cmd.eng_credentials_description': 'Instala motor credentials',
|
|
169
|
+
'cmd.eng_credentials_setup_description': 'Crea archivos de migración credentials',
|
|
170
|
+
'cmd.eng_list_description': 'Lista motores disponibles',
|
|
171
|
+
'cmd.eng_check_description': 'Verifica esquemas de motores',
|
|
172
|
+
'cmd.wallet_broadcast_description': 'Transmite una transacción firmada',
|
|
173
|
+
'cmd.wallet_keccak_description': 'Calcula hash Keccak-256 de un texto',
|
|
174
|
+
'cmd.create_arg_name': 'nombre del proyecto',
|
|
175
|
+
'cmd.create_arg_description': 'descripción del proyecto',
|
|
176
|
+
'cmd.create_arg_required': 'El nombre del proyecto es requerido',
|
|
177
|
+
'cmd.db_mig_make_missing_arg': 'El nombre de la migración es requerido',
|
|
178
|
+
'cmd.e2e_description': 'Ejecuta pruebas E2E (specs con Puppeteer, smoke con axios). Opcional: patrón, --smoke, --grep <filtro>',
|
|
179
|
+
},
|
|
180
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/i18n/types.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,aAAa,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;AAElD,MAAM,MAAM,cAAc,GAAG,MAAM,CAAC,MAAM,EAAE,aAAa,CAAC,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAaA,eAAO,MAAM,UAAU,QAAO,MAE7B,CAAC"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @pasosdejesus/m — Package entry point.
|
|
3
|
+
*
|
|
4
|
+
* Currently only exports getVersion(). The real API lives in subpath exports:
|
|
5
|
+
* @pasosdejesus/m/i18n, /test-utils, /debug, /wba, /wba/routes,
|
|
6
|
+
* /shadcn-components/cn, /shadcn-components/ui/*
|
|
7
|
+
*
|
|
8
|
+
* See API.md for the full catalog.
|
|
9
|
+
*/
|
|
10
|
+
import { createRequire } from 'module';
|
|
11
|
+
const require = createRequire(import.meta.url);
|
|
12
|
+
const pkg = require('../package.json');
|
|
13
|
+
export const getVersion = () => {
|
|
14
|
+
return pkg.version;
|
|
15
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.test.d.ts","sourceRoot":"","sources":["../src/index.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { describe, it, expect } from 'vitest';
|
|
2
|
+
import { getVersion } from './index.js';
|
|
3
|
+
import { createRequire } from 'module';
|
|
4
|
+
describe('getVersion', () => {
|
|
5
|
+
it('should return the correct version from package.json', () => {
|
|
6
|
+
const require = createRequire(import.meta.url);
|
|
7
|
+
const pkg = require('../package.json');
|
|
8
|
+
expect(getVersion()).toBe(pkg.version);
|
|
9
|
+
});
|
|
10
|
+
});
|
package/dist/m.d.ts
ADDED
package/dist/m.d.ts.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"m.d.ts","sourceRoot":"","sources":["../src/m.ts"],"names":[],"mappings":""}
|
package/dist/m.js
ADDED
|
@@ -0,0 +1,334 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
/**
|
|
3
|
+
* m CLI — Main entry point.
|
|
4
|
+
*
|
|
5
|
+
* Registers all generic commands (db:*, wallet:*, m:*, ai:tools, eng:*) in a CommandDef map,
|
|
6
|
+
* parses process.argv manually, and dispatches to the matching handler.
|
|
7
|
+
* PdJ-specific commands are loaded via plugins (see @pasosdejesus/mpdj).
|
|
8
|
+
*/
|
|
9
|
+
import * as dotenv from 'dotenv';
|
|
10
|
+
import * as path from 'path';
|
|
11
|
+
import * as fs from 'fs';
|
|
12
|
+
import { runDbCreate, runDbDrop, runDbSuperCreateUser, runDbStructureDump, runDbStructureLoad, runDbMigrate, runDbRollback, runDbSeed, runDbCheck, runDbConsole, runDbMigMake, runDbTestConnection, runDbDump, runDbRestore } from './tasks/db.js';
|
|
13
|
+
import { runAiContext } from './tasks/context.js';
|
|
14
|
+
import { runAiEdit } from './tasks/edit.js';
|
|
15
|
+
import { runAiReadFile } from './tasks/readfile.js';
|
|
16
|
+
import { runAiWriteFile } from './tasks/writefile.js';
|
|
17
|
+
import { runAiGrep } from './tasks/grep.js';
|
|
18
|
+
import { runAiGlob } from './tasks/glob.js';
|
|
19
|
+
import { runUpdate } from './tasks/update.js';
|
|
20
|
+
import { runE2e } from './tasks/e2e.js';
|
|
21
|
+
import { runEnvDiff } from './tasks/env-diff.js';
|
|
22
|
+
import { runWallet } from './tasks/wallet.js';
|
|
23
|
+
import { runEngine } from './tasks/engine.js';
|
|
24
|
+
import { createTranslator } from './i18n/createTranslator.js';
|
|
25
|
+
import { detectLocale, setLocale } from './util/locale.js';
|
|
26
|
+
import commonCli from './i18n/common-cli.js';
|
|
27
|
+
import { cliTranslations } from './i18n/locales/cli.js';
|
|
28
|
+
import { problem, success } from './util/colors.js';
|
|
29
|
+
import { parseFlags } from './util/cli-parser.js';
|
|
30
|
+
import { getPluginCommands } from './plugin.js';
|
|
31
|
+
// Custom .env loading
|
|
32
|
+
const CWD = process.cwd();
|
|
33
|
+
const searchPaths = [
|
|
34
|
+
path.join(CWD, '../..', '.env'), path.join(CWD, '../..', '.env.test'),
|
|
35
|
+
path.join(CWD, '..', '.env'), path.join(CWD, '..', '.env.test'),
|
|
36
|
+
path.join(CWD, '.env'), path.join(CWD, '.env.test'),
|
|
37
|
+
];
|
|
38
|
+
for (const p of searchPaths) {
|
|
39
|
+
if (fs.existsSync(p))
|
|
40
|
+
dotenv.config({ path: p, override: true, quiet: true });
|
|
41
|
+
}
|
|
42
|
+
async function main() {
|
|
43
|
+
const locale = detectLocale();
|
|
44
|
+
setLocale(locale);
|
|
45
|
+
const cliT = createTranslator(locale, cliTranslations, commonCli);
|
|
46
|
+
const commands = {
|
|
47
|
+
'db:create': { handler: runDbCreate, description: cliT('cmd.db_create_description') },
|
|
48
|
+
'db:drop': { handler: runDbDrop, description: cliT('cmd.db_drop_description') },
|
|
49
|
+
'db:super:createuser': { handler: runDbSuperCreateUser, description: cliT('cmd.db_super_createuser_description') },
|
|
50
|
+
'db:structure:dump': { handler: runDbStructureDump, description: cliT('cmd.db_structure_dump_description') },
|
|
51
|
+
'db:structure:load': { handler: runDbStructureLoad, description: cliT('cmd.db_structure_load_description') },
|
|
52
|
+
'db:migrate': { handler: runDbMigrate, description: cliT('cmd.db_migrate_description') },
|
|
53
|
+
'db:mig:make': {
|
|
54
|
+
handler: (name) => {
|
|
55
|
+
if (!name) {
|
|
56
|
+
problem(cliT('cmd.db_mig_make_missing_arg'));
|
|
57
|
+
process.exit(1);
|
|
58
|
+
}
|
|
59
|
+
return runDbMigMake(name);
|
|
60
|
+
},
|
|
61
|
+
description: cliT('cmd.db_mig_make_description'), argRequired: true, argName: 'name'
|
|
62
|
+
},
|
|
63
|
+
'db:rollback': { handler: runDbRollback, description: cliT('cmd.db_rollback_description'), argOptional: true, argName: '--step N' },
|
|
64
|
+
'db:seed': { handler: runDbSeed, description: cliT('cmd.db_seed_description') },
|
|
65
|
+
'db:check': { handler: runDbCheck, description: cliT('cmd.db_check_description') },
|
|
66
|
+
'db:console': { handler: runDbConsole, description: cliT('cmd.db_console_description'), argOptional: true, argName: 'query' },
|
|
67
|
+
'db:test': { handler: runDbTestConnection, description: cliT('cmd.db_test_connection_description') },
|
|
68
|
+
'db:dump': { handler: (name) => runDbDump(name), description: cliT('cmd.db_dump_description'), argOptional: true, argName: 'name' },
|
|
69
|
+
'db:restore': { handler: (name) => runDbRestore(name), description: cliT('cmd.db_restore_description'), argOptional: true, argName: 'name' },
|
|
70
|
+
'ai:edit': {
|
|
71
|
+
handler: async () => {
|
|
72
|
+
const { options: f } = parseFlags(process.argv.slice(3), { 'dry-run': { type: 'boolean', alias: '-n' } });
|
|
73
|
+
await runAiEdit({ dryRun: !!f['dry-run'] });
|
|
74
|
+
},
|
|
75
|
+
description: cliT('cmd.ai_apply_description'), argOptional: true, argName: 'flags'
|
|
76
|
+
},
|
|
77
|
+
'ai:context': {
|
|
78
|
+
handler: async () => {
|
|
79
|
+
const { options: f } = parseFlags(process.argv.slice(3), {
|
|
80
|
+
'output': { type: 'string' }, 'branch': { type: 'string' }, 'max-size': { type: 'number' },
|
|
81
|
+
'full': { type: 'boolean' }, 'limit': { type: 'number' }, 'no-clip': { type: 'boolean', alias: '--nc' },
|
|
82
|
+
});
|
|
83
|
+
await runAiContext({
|
|
84
|
+
output: f['output'], branch: f['branch'],
|
|
85
|
+
maxSize: typeof f['max-size'] === 'number' ? f['max-size'] * 1024 : undefined,
|
|
86
|
+
full: !!f['full'], limit: f['limit'], noClipboard: !!f['no-clip'],
|
|
87
|
+
});
|
|
88
|
+
},
|
|
89
|
+
description: cliT('cmd.ai_context_description'), argOptional: true, argName: 'output'
|
|
90
|
+
},
|
|
91
|
+
'ai:readfile': {
|
|
92
|
+
handler: async () => { await runAiReadFile(process.argv.slice(3)); },
|
|
93
|
+
description: cliT('cmd.ai_readfile_description'), argOptional: true, argName: 'file'
|
|
94
|
+
},
|
|
95
|
+
'ai:writefile': {
|
|
96
|
+
handler: async () => {
|
|
97
|
+
const args = process.argv.slice(3);
|
|
98
|
+
if (!args[0]) {
|
|
99
|
+
problem(cliT('cmd.ai_writefile_usage'));
|
|
100
|
+
return;
|
|
101
|
+
}
|
|
102
|
+
await runAiWriteFile(args[0]);
|
|
103
|
+
},
|
|
104
|
+
description: cliT('cmd.ai_writefile_description'), argOptional: true, argName: 'file'
|
|
105
|
+
},
|
|
106
|
+
'ai:grep': {
|
|
107
|
+
handler: async () => {
|
|
108
|
+
const { options: f, positional } = parseFlags(process.argv.slice(3), {
|
|
109
|
+
'path': { type: 'string' }, 'type': { type: 'string' },
|
|
110
|
+
'context': { type: 'number', alias: '-C' }, 'ignore-case': { type: 'boolean', alias: '-i' },
|
|
111
|
+
});
|
|
112
|
+
const pattern = positional[0];
|
|
113
|
+
if (!pattern) {
|
|
114
|
+
problem(cliT('cmd.ai_grep_usage'));
|
|
115
|
+
return;
|
|
116
|
+
}
|
|
117
|
+
const opts = {};
|
|
118
|
+
if (f['path'])
|
|
119
|
+
opts.path = f['path'];
|
|
120
|
+
if (f['type'])
|
|
121
|
+
opts.type = f['type'];
|
|
122
|
+
if (f['context'])
|
|
123
|
+
opts.context = f['context'];
|
|
124
|
+
if (f['ignore-case'])
|
|
125
|
+
opts.ignoreCase = true;
|
|
126
|
+
if (!opts.path && positional.length > 1 && !positional[1].startsWith('-'))
|
|
127
|
+
opts.path = positional[1];
|
|
128
|
+
await runAiGrep(pattern, opts);
|
|
129
|
+
},
|
|
130
|
+
description: cliT('cmd.ai_grep_description'), argOptional: true, argName: 'pattern'
|
|
131
|
+
},
|
|
132
|
+
'ai:glob': {
|
|
133
|
+
handler: async () => {
|
|
134
|
+
const { options: f, positional } = parseFlags(process.argv.slice(3), { 'path': { type: 'string' }, 'ignore': { type: 'string' } });
|
|
135
|
+
const pattern = positional[0];
|
|
136
|
+
if (!pattern) {
|
|
137
|
+
problem(cliT('cmd.ai_glob_usage'));
|
|
138
|
+
return;
|
|
139
|
+
}
|
|
140
|
+
await runAiGlob(pattern, { path: f['path'], ignore: f['ignore'] ? [f['ignore']] : undefined });
|
|
141
|
+
},
|
|
142
|
+
description: cliT('cmd.ai_glob_description'), argOptional: true, argName: 'pattern'
|
|
143
|
+
},
|
|
144
|
+
'env:diff': {
|
|
145
|
+
handler: async () => {
|
|
146
|
+
const { positional } = parseFlags(process.argv.slice(3), {});
|
|
147
|
+
await runEnvDiff(positional[0], positional[1]);
|
|
148
|
+
},
|
|
149
|
+
description: cliT('cmd.env_diff_description'), argOptional: true, argName: 'base [target]'
|
|
150
|
+
},
|
|
151
|
+
'm:create': {
|
|
152
|
+
handler: async () => {
|
|
153
|
+
const args = process.argv.slice(3);
|
|
154
|
+
const name = args[0];
|
|
155
|
+
const description = args.slice(1).join(' ');
|
|
156
|
+
if (!name) {
|
|
157
|
+
problem(cliT('cmd.m_create_usage'));
|
|
158
|
+
return;
|
|
159
|
+
}
|
|
160
|
+
await (await import('./tasks/create.js')).runCreateProject(name, description);
|
|
161
|
+
},
|
|
162
|
+
description: cliT('cmd.create_description'), argRequired: true, argName: 'name'
|
|
163
|
+
},
|
|
164
|
+
'm:update': {
|
|
165
|
+
handler: async () => {
|
|
166
|
+
const { options: f } = parseFlags(process.argv.slice(3), { 'check': { type: 'boolean', alias: '-c' }, 'yes': { type: 'boolean', alias: '-y' } });
|
|
167
|
+
await runUpdate({ check: !!f['check'], yes: !!f['yes'] });
|
|
168
|
+
},
|
|
169
|
+
description: cliT('cmd.update_description')
|
|
170
|
+
}
|
|
171
|
+
};
|
|
172
|
+
// Wallet commands
|
|
173
|
+
const walletCmd = (sub) => ({
|
|
174
|
+
handler: async () => { await runWallet([sub, ...process.argv.slice(3)]); },
|
|
175
|
+
description: cliT(`cmd.wallet_${sub.replace(/-/g, '_')}_description`)
|
|
176
|
+
});
|
|
177
|
+
for (const sub of ['generate', 'approve', 'list', 'import', 'sign', 'send', 'balance', 'derive', 'call', 'broadcast', 'keccak']) {
|
|
178
|
+
commands[`wallet:${sub}`] = walletCmd(sub);
|
|
179
|
+
}
|
|
180
|
+
// Engine commands
|
|
181
|
+
const engCmd = (subs, key) => ({
|
|
182
|
+
handler: async () => { await runEngine([...subs, ...process.argv.slice(3)]); },
|
|
183
|
+
description: cliT(`cmd.eng_${key}_description`)
|
|
184
|
+
});
|
|
185
|
+
commands['eng:wba:setup'] = engCmd(['wba', 'setup'], 'wba_setup');
|
|
186
|
+
commands['eng:credentials:setup'] = engCmd(['credentials', 'setup'], 'credentials_setup');
|
|
187
|
+
commands['eng:list'] = engCmd(['list'], 'list');
|
|
188
|
+
commands['eng:check'] = engCmd(['check'], 'check');
|
|
189
|
+
// Hardhat contract commands
|
|
190
|
+
const hasHardhatDir = fs.existsSync(path.join(CWD, 'apps', 'hardhat'))
|
|
191
|
+
|| fs.existsSync(path.join(CWD, '..', 'hardhat')) || fs.existsSync(path.join(CWD, 'hardhat'))
|
|
192
|
+
|| fs.existsSync(path.join(CWD, 'hardhat.config.ts')) || fs.existsSync(path.join(CWD, 'hardhat.config.js'));
|
|
193
|
+
if (hasHardhatDir) {
|
|
194
|
+
commands['contract:test'] = {
|
|
195
|
+
handler: async (arg) => {
|
|
196
|
+
// Lazy-load the contract-test package, which registers via plugin system
|
|
197
|
+
await import('@pasosdejesus/contract-test');
|
|
198
|
+
// Invoke the handler registered by the plugin
|
|
199
|
+
const pluginCmds = getPluginCommands();
|
|
200
|
+
const cmd = pluginCmds['contract:test'];
|
|
201
|
+
if (cmd?.handler) {
|
|
202
|
+
await cmd.handler(arg);
|
|
203
|
+
}
|
|
204
|
+
},
|
|
205
|
+
description: cliT('cmd.contract_test_description')
|
|
206
|
+
};
|
|
207
|
+
}
|
|
208
|
+
// test:e2e
|
|
209
|
+
const hasE2eDir = fs.existsSync(path.join(CWD, 'e2e'));
|
|
210
|
+
if (hasE2eDir) {
|
|
211
|
+
commands['test:e2e'] = {
|
|
212
|
+
handler: async (arg) => { await runE2e(arg, process.argv.slice(3)); },
|
|
213
|
+
description: cliT('cmd.e2e_description'), argOptional: true,
|
|
214
|
+
};
|
|
215
|
+
}
|
|
216
|
+
// ── Help ──
|
|
217
|
+
function showVersion() {
|
|
218
|
+
const pkg = JSON.parse(fs.readFileSync(new URL('../package.json', import.meta.url), 'utf-8'));
|
|
219
|
+
success(`m CLI v${pkg.version}`);
|
|
220
|
+
}
|
|
221
|
+
function showHelp() {
|
|
222
|
+
console.log(cliT('usage_line'));
|
|
223
|
+
console.log();
|
|
224
|
+
console.log(cliT('cmd.options_header'));
|
|
225
|
+
console.log(' -V, --version ' + cliT('cmd.version_description'));
|
|
226
|
+
console.log(' -h, --help ' + cliT('cmd.help_description'));
|
|
227
|
+
console.log();
|
|
228
|
+
console.log(cliT('cmd.commands_header'));
|
|
229
|
+
function findProjectRoot(start) {
|
|
230
|
+
let current = start;
|
|
231
|
+
while (current !== path.parse(current).root) {
|
|
232
|
+
if (fs.existsSync(path.join(current, 'apps')))
|
|
233
|
+
return current;
|
|
234
|
+
current = path.dirname(current);
|
|
235
|
+
}
|
|
236
|
+
return start;
|
|
237
|
+
}
|
|
238
|
+
function findProjectPackage(root) {
|
|
239
|
+
const pkgPath = path.join(root, 'package.json');
|
|
240
|
+
if (fs.existsSync(pkgPath))
|
|
241
|
+
return JSON.parse(fs.readFileSync(pkgPath, 'utf-8'));
|
|
242
|
+
return null;
|
|
243
|
+
}
|
|
244
|
+
const projectRoot = findProjectRoot(process.cwd());
|
|
245
|
+
const projectPkg = findProjectPackage(projectRoot);
|
|
246
|
+
const hasKysely = projectPkg?.dependencies?.kysely || projectPkg?.devDependencies?.kysely;
|
|
247
|
+
const hasViem = projectPkg?.dependencies?.viem || projectPkg?.devDependencies?.viem;
|
|
248
|
+
const hasHardhat = fs.existsSync(path.join(projectRoot, 'apps', 'hardhat'))
|
|
249
|
+
|| fs.existsSync(path.join(projectRoot, 'hardhat'))
|
|
250
|
+
|| fs.existsSync(path.join(projectRoot, 'hardhat.config.ts'))
|
|
251
|
+
|| fs.existsSync(path.join(projectRoot, 'hardhat.config.js'));
|
|
252
|
+
const categories = {
|
|
253
|
+
'AI': ['ai:context', 'ai:edit', 'ai:readfile', 'ai:writefile', 'ai:grep', 'ai:glob'],
|
|
254
|
+
'ENV': ['env:diff'],
|
|
255
|
+
'Project': ['m:create', 'm:update'],
|
|
256
|
+
'Test': ['test:e2e'],
|
|
257
|
+
};
|
|
258
|
+
if (hasHardhat)
|
|
259
|
+
categories['Contracts'] = ['contract:test'];
|
|
260
|
+
if (hasKysely) {
|
|
261
|
+
categories['Database'] = ['db:create', 'db:drop', 'db:super:createuser', 'db:structure:dump', 'db:structure:load',
|
|
262
|
+
'db:migrate', 'db:mig:make', 'db:rollback', 'db:seed', 'db:check', 'db:console', 'db:test', 'db:dump', 'db:restore'];
|
|
263
|
+
categories['Engine'] = ['eng:wba:setup', 'eng:credentials:setup', 'eng:list', 'eng:check'];
|
|
264
|
+
}
|
|
265
|
+
if (hasViem) {
|
|
266
|
+
categories['Wallet'] = ['wallet:generate', 'wallet:approve', 'wallet:list', 'wallet:import', 'wallet:send', 'wallet:balance', 'wallet:sign', 'wallet:broadcast', 'wallet:call', 'wallet:derive', 'wallet:keccak'];
|
|
267
|
+
}
|
|
268
|
+
// Plugin categories
|
|
269
|
+
const pluginCmds = getPluginCommands();
|
|
270
|
+
const pluginNames = Object.keys(pluginCmds);
|
|
271
|
+
if (pluginNames.some(n => n.startsWith('ai:'))) {
|
|
272
|
+
categories['AI'] = [...(categories['AI'] || []), ...pluginNames.filter(n => n.startsWith('ai:'))];
|
|
273
|
+
}
|
|
274
|
+
if (pluginNames.some(n => n.startsWith('req:'))) {
|
|
275
|
+
categories['Requirements'] = pluginNames.filter(n => n.startsWith('req:'));
|
|
276
|
+
}
|
|
277
|
+
if (pluginNames.some(n => n.startsWith('eng:credentials:'))) {
|
|
278
|
+
categories['Engine/Credentials'] = pluginNames.filter(n => n.startsWith('eng:credentials:'));
|
|
279
|
+
}
|
|
280
|
+
for (const [category, cmdNames] of Object.entries(categories)) {
|
|
281
|
+
console.log(` ${category}:`);
|
|
282
|
+
for (const cmdName of cmdNames) {
|
|
283
|
+
const cmd = commands[cmdName];
|
|
284
|
+
if (cmd) {
|
|
285
|
+
let syntax = cmdName;
|
|
286
|
+
if (cmd.argRequired)
|
|
287
|
+
syntax += ` <${cmd.argName || 'name'}>`;
|
|
288
|
+
else if (cmd.argOptional)
|
|
289
|
+
syntax += ` [${cmd.argName || 'output'}]`;
|
|
290
|
+
console.log(` ${syntax.padEnd(30)} ${cmd.description}`);
|
|
291
|
+
}
|
|
292
|
+
}
|
|
293
|
+
console.log();
|
|
294
|
+
}
|
|
295
|
+
}
|
|
296
|
+
// Load plugin commands (deferred for async plugin registration)
|
|
297
|
+
const pluginCmds = getPluginCommands();
|
|
298
|
+
for (const [name, def] of Object.entries(pluginCmds)) {
|
|
299
|
+
commands[name] = def;
|
|
300
|
+
}
|
|
301
|
+
// Parse command line arguments
|
|
302
|
+
const args = process.argv.slice(2);
|
|
303
|
+
if (args.length === 0 || args[0] === '--help' || args[0] === '-h') {
|
|
304
|
+
showHelp();
|
|
305
|
+
process.exit(0);
|
|
306
|
+
}
|
|
307
|
+
if (args[0] === '--version' || args[0] === '-V') {
|
|
308
|
+
showVersion();
|
|
309
|
+
process.exit(0);
|
|
310
|
+
}
|
|
311
|
+
const commandName = args[0];
|
|
312
|
+
const commandArg = args[1];
|
|
313
|
+
const command = commands[commandName];
|
|
314
|
+
if (!command) {
|
|
315
|
+
problem(cliT('cmd.command_not_found', commandName));
|
|
316
|
+
console.log();
|
|
317
|
+
showHelp();
|
|
318
|
+
process.exit(1);
|
|
319
|
+
}
|
|
320
|
+
if (command.argRequired && !commandArg) {
|
|
321
|
+
problem(cliT('cmd.argument_required', commandName));
|
|
322
|
+
console.log();
|
|
323
|
+
showHelp();
|
|
324
|
+
process.exit(1);
|
|
325
|
+
}
|
|
326
|
+
try {
|
|
327
|
+
await command.handler(commandArg);
|
|
328
|
+
}
|
|
329
|
+
catch (error) {
|
|
330
|
+
problem(error.message || 'Unknown error');
|
|
331
|
+
process.exit(1);
|
|
332
|
+
}
|
|
333
|
+
}
|
|
334
|
+
main().catch(err => { problem(err.message); process.exit(1); });
|
package/dist/plugin.d.ts
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export interface CommandDef {
|
|
2
|
+
handler: (arg?: string) => Promise<void> | void;
|
|
3
|
+
description: string;
|
|
4
|
+
argRequired?: boolean;
|
|
5
|
+
argOptional?: boolean;
|
|
6
|
+
argName?: string;
|
|
7
|
+
}
|
|
8
|
+
export declare function registerCommands(commands: Record<string, CommandDef>): void;
|
|
9
|
+
export declare function getPluginCommands(): Record<string, CommandDef>;
|
|
10
|
+
//# sourceMappingURL=plugin.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"plugin.d.ts","sourceRoot":"","sources":["../src/plugin.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,UAAU;IACzB,OAAO,EAAE,CAAC,GAAG,CAAC,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC;IAChD,WAAW,EAAE,MAAM,CAAC;IACpB,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAID,wBAAgB,gBAAgB,CAAC,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,UAAU,CAAC,GAAG,IAAI,CAE3E;AAED,wBAAgB,iBAAiB,IAAI,MAAM,CAAC,MAAM,EAAE,UAAU,CAAC,CAE9D"}
|
package/dist/plugin.js
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* cn() — Tailwind class merging utility.
|
|
3
|
+
*
|
|
4
|
+
* Combines clsx (conditional classes) with tailwind-merge (conflict resolution).
|
|
5
|
+
* Shadcn UI components use this internally; projects can import it directly
|
|
6
|
+
* via @pasosdejesus/m/shadcn-components/cn.
|
|
7
|
+
*
|
|
8
|
+
* Why not just clsx? tailwind-merge handles conflicting Tailwind utilities
|
|
9
|
+
* (e.g., combining "px-4" and "px-2" keeps the last one).
|
|
10
|
+
*/
|
|
11
|
+
import { type ClassValue } from 'clsx';
|
|
12
|
+
export declare function cn(...inputs: ClassValue[]): string;
|
|
13
|
+
//# sourceMappingURL=cn.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cn.d.ts","sourceRoot":"","sources":["../../src/shadcn_components/cn.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AACH,OAAO,EAAQ,KAAK,UAAU,EAAE,MAAM,MAAM,CAAA;AAG5C,wBAAgB,EAAE,CAAC,GAAG,MAAM,EAAE,UAAU,EAAE,UAEzC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* cn() — Tailwind class merging utility.
|
|
3
|
+
*
|
|
4
|
+
* Combines clsx (conditional classes) with tailwind-merge (conflict resolution).
|
|
5
|
+
* Shadcn UI components use this internally; projects can import it directly
|
|
6
|
+
* via @pasosdejesus/m/shadcn-components/cn.
|
|
7
|
+
*
|
|
8
|
+
* Why not just clsx? tailwind-merge handles conflicting Tailwind utilities
|
|
9
|
+
* (e.g., combining "px-4" and "px-2" keeps the last one).
|
|
10
|
+
*/
|
|
11
|
+
import { clsx } from 'clsx';
|
|
12
|
+
import { twMerge } from 'tailwind-merge';
|
|
13
|
+
export function cn(...inputs) {
|
|
14
|
+
return twMerge(clsx(inputs));
|
|
15
|
+
}
|