|
| 1 | +# Development |
| 2 | + |
| 3 | +## Prerequisites |
| 4 | + |
| 5 | +- Node.js 18+ |
| 6 | +- npm |
| 7 | + |
| 8 | +## Setup |
| 9 | + |
| 10 | +```bash |
| 11 | +git clone https://github.com/srcpush/code-push-cli.git |
| 12 | +cd code-push-cli |
| 13 | +npm install |
| 14 | +``` |
| 15 | + |
| 16 | +## Scripts |
| 17 | + |
| 18 | +| Script | Description | |
| 19 | +|--------|-------------| |
| 20 | +| `npm run build` | Build `dist/cli.js` and `dist/index.js` with Vite | |
| 21 | +| `npm run dev` | Watch mode build | |
| 22 | +| `npm test` | Run Vitest suite | |
| 23 | +| `npm run test:watch` | Vitest in watch mode | |
| 24 | +| `npm run typecheck` | TypeScript check (`tsconfig.build.json`) | |
| 25 | +| `npm run lint` | ESLint on `src/` and `tests/` | |
| 26 | +| `npm run format` | Prettier write | |
| 27 | + |
| 28 | +## Project layout |
| 29 | + |
| 30 | +``` |
| 31 | +src/ |
| 32 | +├── cli.ts # CLI entry (shebang) |
| 33 | +├── index.ts # SDK export (AccountManager) |
| 34 | +├── commands/ # parser, executor, debug |
| 35 | +├── sdk/ # management + acquisition SDKs |
| 36 | +├── lib/ # hash, sign, react-native helpers |
| 37 | +├── types/ # shared types |
| 38 | +└── utils/ # file utilities |
| 39 | +
|
| 40 | +tests/ |
| 41 | +├── unit/ # hash, management-sdk, acquisition-sdk |
| 42 | +├── integration/ # CLI command tests |
| 43 | +├── fixtures/ # TestApp, zip archives |
| 44 | +└── helpers/ # mocks and setup |
| 45 | +``` |
| 46 | + |
| 47 | +## Local CLI smoke test |
| 48 | + |
| 49 | +```bash |
| 50 | +npm run build |
| 51 | +node dist/cli.js -h |
| 52 | +npm link # optional: install `srcpush` globally |
| 53 | +``` |
| 54 | + |
| 55 | +## Hash utility sync |
| 56 | + |
| 57 | +`src/lib/hash.ts` must stay in sync with `api/src/utils/hash-utils.ts` in the monorepo. Any hashing change requires updating both files. |
0 commit comments