Skip to content

Commit c9970ed

Browse files
feat: publish @telivityhaip packages to npm (#83)
- Rename @haip/* → @telivityhaip/* across all packages, imports, docs, Dockerfile, CI workflow, and tsconfig paths - Remove private:true from packages/shared and packages/database to enable publish; add publishConfig + files + repository fields - Keep apps/api, apps/dashboard, tools/* private (not libraries) - Add .github/workflows/publish.yml triggered on release + workflow_dispatch (dry-run then publish with NPM_TOKEN) pnpm publish dry-run verified locally: - @telivityhaip/shared@0.0.1 (8 files, 6.6 kB) - @telivityhaip/database@0.0.1 (16 files) 575/575 tests passing, build + typecheck clean. Co-authored-by: Dušan Milićević <dusanmilicevic33@gmail.com> Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent c350ce5 commit c9970ed

52 files changed

Lines changed: 133 additions & 73 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ jobs:
2626
- run: pnpm install --frozen-lockfile
2727

2828
- name: Build packages
29-
run: pnpm -r --filter @haip/shared --filter @haip/database run build
29+
run: pnpm -r --filter @telivityhaip/shared --filter @telivityhaip/database run build
3030

3131
- name: Lint
3232
run: pnpm lint

.github/workflows/publish.yml

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
name: Publish to npm
2+
3+
on:
4+
release:
5+
types: [published]
6+
workflow_dispatch:
7+
8+
jobs:
9+
publish:
10+
runs-on: ubuntu-latest
11+
permissions:
12+
contents: read
13+
steps:
14+
- uses: actions/checkout@v4
15+
16+
- uses: pnpm/action-setup@v4
17+
18+
- uses: actions/setup-node@v4
19+
with:
20+
node-version: 22
21+
cache: 'pnpm'
22+
registry-url: 'https://registry.npmjs.org'
23+
24+
- name: Install dependencies
25+
run: pnpm install --frozen-lockfile
26+
27+
- name: Build all packages
28+
run: pnpm build
29+
30+
- name: Dry-run publish
31+
run: pnpm -r publish --access public --no-git-checks --dry-run
32+
env:
33+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
34+
35+
- name: Publish to npm
36+
run: pnpm -r publish --access public --no-git-checks
37+
env:
38+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

README.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -369,16 +369,16 @@ cp .env.example .env
369369
pnpm build
370370

371371
# Run database migrations
372-
pnpm --filter @haip/api run migrate
372+
pnpm --filter @telivityhaip/api run migrate
373373

374374
# Seed demo data (Telivity Grand Hotel)
375-
pnpm --filter @haip/api run seed
375+
pnpm --filter @telivityhaip/api run seed
376376

377377
# Start the API (with hot reload)
378378
pnpm dev
379379

380380
# In a separate terminal — start the dashboard
381-
pnpm --filter @haip/dashboard dev
381+
pnpm --filter @telivityhaip/dashboard dev
382382
```
383383

384384
- API: `http://localhost:3000`
@@ -401,10 +401,10 @@ This starts PostgreSQL, Redis, Keycloak, and the HAIP API + Dashboard in a singl
401401
pnpm test
402402

403403
# API tests only
404-
pnpm --filter @haip/api test
404+
pnpm --filter @telivityhaip/api test
405405

406406
# Dashboard component tests
407-
pnpm --filter @haip/dashboard test
407+
pnpm --filter @telivityhaip/dashboard test
408408

409409
# Type checking
410410
pnpm typecheck

apps/api/Dockerfile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,14 +20,14 @@ COPY apps/api/ ./apps/api/
2020
COPY apps/dashboard/ ./apps/dashboard/
2121

2222
# Build workspace packages
23-
RUN pnpm --filter @haip/shared run build
24-
RUN pnpm --filter @haip/database run build
23+
RUN pnpm --filter @telivityhaip/shared run build
24+
RUN pnpm --filter @telivityhaip/database run build
2525

2626
# Build dashboard (Vite static output)
2727
RUN pnpm --filter dashboard run build
2828

2929
# Build API (NestJS)
30-
RUN pnpm --filter @haip/api run build
30+
RUN pnpm --filter @telivityhaip/api run build
3131

3232
# Production stage
3333
FROM node:20-alpine AS production

apps/api/package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"name": "@haip/api",
2+
"name": "@telivityhaip/api",
33
"version": "0.0.1",
44
"description": "HAIP API — NestJS REST API for the Hotel AI Platform",
55
"private": true,
@@ -17,8 +17,8 @@
1717
"clean": "rm -rf dist"
1818
},
1919
"dependencies": {
20-
"@haip/database": "workspace:*",
21-
"@haip/shared": "workspace:^",
20+
"@telivityhaip/database": "workspace:*",
21+
"@telivityhaip/shared": "workspace:^",
2222
"@nestjs/common": "^10.4.0",
2323
"@nestjs/config": "^3.3.0",
2424
"@nestjs/core": "^10.4.0",

apps/api/src/database/database.module.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { Global, Module } from '@nestjs/common';
22
import { ConfigService } from '@nestjs/config';
33
import { drizzle } from 'drizzle-orm/postgres-js';
44
import postgres from 'postgres';
5-
import * as schema from '@haip/database';
5+
import * as schema from '@telivityhaip/database';
66

77
export const DRIZZLE = Symbol('DRIZZLE');
88

apps/api/src/modules/agent/agent.controller.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import {
1212
} from '@nestjs/common';
1313
import { ApiTags, ApiOperation, ApiQuery } from '@nestjs/swagger';
1414
import { eq, and, desc } from 'drizzle-orm';
15-
import { guestReviews } from '@haip/database';
15+
import { guestReviews } from '@telivityhaip/database';
1616
import { DRIZZLE } from '../../database/database.module';
1717
import { Roles } from '../auth/roles.decorator';
1818
import { CurrentUser, type AuthUser } from '../auth/current-user.decorator';

apps/api/src/modules/agent/agent.service.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { Injectable, Inject, NotFoundException, BadRequestException } from '@nestjs/common';
22
import { eq, and, desc } from 'drizzle-orm';
3-
import { agentConfigs, agentDecisions, agentTrainingSnapshots, auditLogs } from '@haip/database';
3+
import { agentConfigs, agentDecisions, agentTrainingSnapshots, auditLogs } from '@telivityhaip/database';
44
import { DRIZZLE } from '../../database/database.module';
55
import { WebhookService } from '../webhook/webhook.service';
66
import type {

apps/api/src/modules/agent/cancellation/cancellation-predictor.agent.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { Injectable, Inject, OnModuleInit } from '@nestjs/common';
22
import { eq, and, gte, not, inArray } from 'drizzle-orm';
3-
import { reservations, guests, folios, payments, bookings } from '@haip/database';
3+
import { reservations, guests, folios, payments, bookings } from '@telivityhaip/database';
44
import { DRIZZLE } from '../../../database/database.module';
55
import { AgentService } from '../agent.service';
66
import type {

apps/api/src/modules/agent/channel-mix/channel-mix.agent.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { Injectable, Inject, OnModuleInit } from '@nestjs/common';
22
import { eq, and, desc } from 'drizzle-orm';
3-
import { channelConnections, bookings, reservations, agentDecisions } from '@haip/database';
3+
import { channelConnections, bookings, reservations, agentDecisions } from '@telivityhaip/database';
44
import { DRIZZLE } from '../../../database/database.module';
55
import { AgentService } from '../agent.service';
66
import type {

0 commit comments

Comments
 (0)