diff --git a/README.md b/README.md index 33b29a6..2b550f0 100644 --- a/README.md +++ b/README.md @@ -11,20 +11,8 @@ npm install npm run build ``` -### 2. Push to Git - -```bash -git init -git add . -git commit -m "Initial commit: shared types package" -git remote add origin -git push -u origin main -``` - ## Usage in Other Projects -### Option 1: Install from Git (HTTPS) - Add to your project's `package.json`: ```json @@ -41,58 +29,6 @@ Or install via command: npm install git+https://github.com/your-org/shared-types.git ``` -### Option 2: Install from Git (SSH) - -```json -{ - "dependencies": { - "@your-org/shared-types": "git+ssh://git@github.com:your-org/shared-types.git" - } -} -``` - -### Option 3: Install specific branch or tag - -```json -{ - "dependencies": { - "@your-org/shared-types": "git+https://github.com/your-org/shared-types.git#v1.0.0" - } -} -``` - -Or for a branch: - -```json -{ - "dependencies": { - "@your-org/shared-types": "git+https://github.com/your-org/shared-types.git#develop" - } -} -``` - -## Using the Types - -```typescript -import { User, ApiResponse, Status } from '@your-org/shared-types'; - -const user: User = { - id: '123', - email: 'user@example.com', - name: 'John Doe', - createdAt: new Date(), - updatedAt: new Date() -}; - -const response: ApiResponse = { - success: true, - data: user, - message: 'User retrieved successfully' -}; - -const status = Status.Active; -``` - ## Updating the Package When you make changes to the types: @@ -100,42 +36,4 @@ When you make changes to the types: 1. Update the version in `package.json` 2. Build the package: `npm run build` 3. Commit and push changes -4. Update consuming applications: `npm update @your-org/shared-types` - -## Development Workflow - -### Adding New Types - -1. Create new `.ts` files in the `src/` directory -2. Export types from `src/index.ts` -3. Build and test: `npm run build` -4. Commit changes and push - -### Versioning - -Follow semantic versioning: -- **MAJOR**: Breaking changes -- **MINOR**: New features, backward compatible -- **PATCH**: Bug fixes, backward compatible - -### Best Practices - -- Keep types focused and modular -- Use clear, descriptive names -- Document complex types with JSDoc comments -- Avoid coupling to specific implementations -- Export everything through `index.ts` - -## Structure - -``` -shared-types/ -├── src/ -│ ├── index.ts # Main export file -│ └── types.ts # Type definitions -├── dist/ # Compiled output (generated) -├── package.json -├── tsconfig.json -├── .gitignore -└── README.md -``` +4. Update consuming applications: `npm update @dpu/types`