Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
88 changes: 88 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
name: CI

on:
push:
branches: [main, develop]
pull_request:
branches: [main, develop]

jobs:
lint-test-build:
name: Lint, Test & Build
runs-on: ubuntu-latest

strategy:
matrix:
node-version: [20.x, 22.x]

steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Setup Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
cache: 'npm'

- name: Install dependencies
run: npm ci

- name: Lint library
run: npm run lint:lib

- name: Lint showcase
run: npx nx run showcase:lint

- name: Test library
run: npm run test:lib -- --coverage --watchAll=false

- name: Build library
run: npm run build:lib

- name: Verify built package peer dependencies
run: node -e "const p=require('./dist/libs/logrocket-angular/package.json'); if(!p.peerDependencies?.logrocket) process.exit(1);"

- name: Build showcase
run: npm run build:showcase

- name: Upload coverage to Codecov
if: matrix.node-version == '20.x'
uses: codecov/codecov-action@v4
with:
files: ./coverage/libs/logrocket-angular/lcov.info
flags: unittests
name: codecov-logrocket-angular
fail_ci_if_error: false

publish-check:
name: Publish Check
runs-on: ubuntu-latest
needs: lint-test-build

steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '20.x'
cache: 'npm'

- name: Install dependencies
run: npm ci

- name: Build library
run: npm run build:lib

- name: Verify built package peer dependencies
run: node -e "const p=require('./dist/libs/logrocket-angular/package.json'); if(!p.peerDependencies?.logrocket) process.exit(1);"

- name: Build showcase
run: npm run build:showcase

- name: Pack library (dry-run)
run: npm run pack:lib
45 changes: 45 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
# Publishes @grandgular/logrocket-angular from dist/libs/logrocket-angular.
# Prerequisites: NPM_TOKEN repository secret (npm automation access token).
# Optional: configure "Trusted publishing" on npm for this package to use OIDC without a long-lived token.
# GitHub repo About: add description + topics, e.g. angular, logrocket, session-replay, monitoring, typescript, angular-library, rxjs.

name: Publish npm

on:
workflow_dispatch:
push:
tags:
- 'v*.*.*'

permissions:
contents: read
id-token: write

jobs:
publish:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '20.x'
registry-url: 'https://registry.npmjs.org'
cache: 'npm'

- name: Install dependencies
run: npm ci

- name: Build library
run: npm run build:lib

- name: Verify built package peer dependencies
run: node -e "const p=require('./dist/libs/logrocket-angular/package.json'); if(!p.peerDependencies?.logrocket) process.exit(1);"

- name: Publish to npm
working-directory: dist/libs/logrocket-angular
run: npm publish --access public --provenance
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
49 changes: 49 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
# See https://docs.github.com/en/get-started/getting-started-with-git/ignoring-files for more about ignoring files.

# compiled output
dist
tmp
out-tsc

# dependencies
node_modules

# IDEs and editors
.idea/
.project
.classpath
.c9/
*.launch
.settings/
*.sublime-workspace
.cursor
.codex

# IDE - VSCode
.vscode/*
!.vscode/settings.json
!.vscode/tasks.json
!.vscode/launch.json
!.vscode/extensions.json

# misc
/.sass-cache
/connect.lock
/coverage
/libpeerconnection.log
npm-debug.log
yarn-error.log
testem.log
/typings

# System Files
.DS_Store
Thumbs.db

.nx/cache
.nx/workspace-data

.angular

# Local docs (not for public repo)
/docs
6 changes: 6 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# Add files here to ignore them from prettier formatting
/dist
/coverage
/.nx/cache
/.nx/workspace-data
.angular
3 changes: 3 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"singleQuote": true
}
28 changes: 28 additions & 0 deletions .verdaccio/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# path to a directory with all packages
storage: ../tmp/local-registry/storage

# a list of other known repositories we can talk to
uplinks:
npmjs:
url: https://registry.npmjs.org/
maxage: 60m

packages:
'**':
# give all users (including non-authenticated users) full access
# because it is a local registry
access: $all
publish: $all
unpublish: $all

# if package is not available locally, proxy requests to npm registry
proxy: npmjs

# log settings
log:
type: stdout
format: pretty
level: warn

publish:
allow_offline: true # set offline to true to allow publish offline
27 changes: 27 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# Changelog

All notable changes to this project are documented in this file.

The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [Unreleased]

## [0.1.0] - 2026-04-27

### Added

- Nx workspace and publishable Angular package `@grandgular/logrocket-angular` (skeleton, build, test, lint, pack scripts).
- Documentation: community companion positioning, parity table with `logrocket-react`, compatibility matrix, recipes (consent/CMP, release, lazy routes, `ENVIRONMENT_INITIALIZER`, testing).
- `setupLogRocketUserFlowLabels()` and `LogRocketLabelDirective` for optional `data-lr-name` / `__lrName` click annotation (best-effort, similar pattern to `logrocket-react`).
- Secondary entry `@grandgular/logrocket-angular/testing` with `createNoOpLogRocketService()` and `provideNoOpLogRocket()` for unit tests.
- Showcase: `setupLogRocketUserFlowLabels()` after bootstrap; labeled Track button.
- `SECURITY.md` and CI step to assert `logrocket` peer dependency in the built `package.json`.

### Changed

- Root and library README: clarify unofficial / community-maintained status; document `rxjs` peer.
- Library `package.json` description and keywords expanded for npm discovery; publishable README with quickstart and badges; root `CHANGELOG.md` copied into the npm artifact after build (`build:lib` script).

[Unreleased]: https://github.com/Grandgular/logrocket/compare/v0.1.0...HEAD
[0.1.0]: https://github.com/Grandgular/logrocket/releases/tag/v0.1.0
Loading
Loading