|
| 1 | +# Onboarding Guide |
| 2 | + |
| 3 | +**New Contributor Quickstart** — Get started with Package URL development in 5 minutes. |
| 4 | + |
| 5 | +--- |
| 6 | + |
| 7 | +## 📋 Prerequisites |
| 8 | + |
| 9 | +``` |
| 10 | +Required: |
| 11 | + ✓ Node.js 20+ (LTS recommended) |
| 12 | + ✓ pnpm 9+ |
| 13 | + ✓ Git |
| 14 | +``` |
| 15 | + |
| 16 | +--- |
| 17 | + |
| 18 | +## 🚀 Quick Start |
| 19 | + |
| 20 | +### 1. Clone & Setup |
| 21 | + |
| 22 | +```bash |
| 23 | +# Clone |
| 24 | +git clone https://github.com/SocketDev/socket-packageurl-js.git |
| 25 | +cd socket-packageurl-js |
| 26 | + |
| 27 | +# Install & verify |
| 28 | +pnpm install |
| 29 | +pnpm test |
| 30 | +``` |
| 31 | + |
| 32 | +**Expected:** ✓ 100% test coverage, ✓ 100% type coverage |
| 33 | + |
| 34 | +--- |
| 35 | + |
| 36 | +### 2. Project Structure |
| 37 | + |
| 38 | +``` |
| 39 | +socket-packageurl-js/ |
| 40 | +├── src/ # Source code |
| 41 | +│ ├── index.ts # Main PackageURL class |
| 42 | +│ ├── parse.ts # Parser implementation |
| 43 | +│ ├── builder.ts # Builder implementation |
| 44 | +│ └── types.ts # TypeScript definitions |
| 45 | +│ |
| 46 | +├── test/ # Tests (mirrors src/) |
| 47 | +├── scripts/ # Build scripts |
| 48 | +└── docs/ # Documentation |
| 49 | + ├── api-reference.md |
| 50 | + ├── usage-examples.md |
| 51 | + └── getting-started.md |
| 52 | +``` |
| 53 | + |
| 54 | +--- |
| 55 | + |
| 56 | +### 3. Essential Commands |
| 57 | + |
| 58 | +```bash |
| 59 | +# Development |
| 60 | +pnpm run dev # Watch mode |
| 61 | +pnpm build # Build for production |
| 62 | + |
| 63 | +# Testing |
| 64 | +pnpm test # Run tests |
| 65 | +pnpm run cover # With coverage |
| 66 | + |
| 67 | +# Quality |
| 68 | +pnpm run check # Type check + lint |
| 69 | +pnpm run fix # Auto-fix issues |
| 70 | +``` |
| 71 | + |
| 72 | +--- |
| 73 | + |
| 74 | +## 🧪 What is a Package URL? |
| 75 | + |
| 76 | +A Package URL (purl) standardizes software package identification: |
| 77 | + |
| 78 | +``` |
| 79 | +pkg:npm/lodash@4.17.21 |
| 80 | +│ │ │ │ |
| 81 | +│ │ │ └─ Version |
| 82 | +│ │ └──────── Name |
| 83 | +│ └──────────── Namespace (optional) |
| 84 | +└──────────────── Type (ecosystem) |
| 85 | +``` |
| 86 | + |
| 87 | +**Supported ecosystems:** |
| 88 | +- npm, pypi, cargo, gem, maven, nuget, go, docker, etc. |
| 89 | + |
| 90 | +--- |
| 91 | + |
| 92 | +## 💡 Development Workflow |
| 93 | + |
| 94 | +``` |
| 95 | +1. Branch → git checkout -b feature/my-change |
| 96 | +2. Implement → Edit src/ files |
| 97 | +3. Test → pnpm test (100% coverage required) |
| 98 | +4. Verify → pnpm run fix && pnpm test |
| 99 | +5. Commit → Conventional commits |
| 100 | +6. PR → Submit pull request |
| 101 | +``` |
| 102 | + |
| 103 | +--- |
| 104 | + |
| 105 | +## 📚 Key Concepts |
| 106 | + |
| 107 | +### 1. Spec Compliance |
| 108 | + |
| 109 | +This library implements the [Package URL specification](https://github.com/package-url/purl-spec). |
| 110 | + |
| 111 | +All changes must maintain spec compliance. |
| 112 | + |
| 113 | +### 2. Zero Dependencies |
| 114 | + |
| 115 | +Runtime has zero dependencies. All code is self-contained. |
| 116 | + |
| 117 | +### 3. Type Safety |
| 118 | + |
| 119 | +Full TypeScript support with 100% type coverage: |
| 120 | + |
| 121 | +```typescript |
| 122 | +import { PackageURL } from '@socketregistry/packageurl-js' |
| 123 | + |
| 124 | +const purl = new PackageURL( |
| 125 | + 'npm', // type |
| 126 | + null, // namespace |
| 127 | + 'lodash', // name |
| 128 | + '4.17.21', // version |
| 129 | + null, // qualifiers |
| 130 | + null // subpath |
| 131 | +) |
| 132 | +``` |
| 133 | + |
| 134 | +--- |
| 135 | + |
| 136 | +## 📖 Additional Resources |
| 137 | + |
| 138 | +- [API Reference](./api-reference.md) - Complete API docs |
| 139 | +- [Usage Examples](./usage-examples.md) - Common patterns |
| 140 | +- [Getting Started](./getting-started.md) - Detailed setup |
| 141 | +- [CLAUDE.md](../CLAUDE.md) - Development standards |
| 142 | + |
| 143 | +--- |
| 144 | + |
| 145 | +## ✅ Checklist |
| 146 | + |
| 147 | +- [ ] Installed dependencies (`pnpm install`) |
| 148 | +- [ ] Tests passing (`pnpm test`) |
| 149 | +- [ ] Read [API Reference](./api-reference.md) |
| 150 | +- [ ] Understand Package URL spec |
| 151 | +- [ ] Know commit format (conventional commits) |
| 152 | +- [ ] Ready to contribute! |
| 153 | + |
| 154 | +**Welcome!** 🎉 |
0 commit comments