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
8 changes: 4 additions & 4 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,14 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [18.x, 20.x, 22.x]
node-version: [20.x, 22.x, 24.x]

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

- name: Setup Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
uses: actions/setup-node@v6
with:
node-version: ${{ matrix.node-version }}
cache: 'npm'
Expand All @@ -36,7 +36,7 @@ jobs:
echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV

- name: Setup pnpm cache
uses: actions/cache@v4
uses: actions/cache@v5
with:
path: ${{ env.STORE_PATH }}
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:

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

Expand All @@ -36,9 +36,9 @@ jobs:
pip install sphinx sphinx-rtd-theme myst-parser sphinx-autodoc-typehints linkify-it-py

- name: Setup Node.js for TypeScript docs
uses: actions/setup-node@v4
uses: actions/setup-node@v6
with:
node-version: '20.x'
node-version: '22.x'

- name: Install pnpm
uses: pnpm/action-setup@v4
Expand Down
169 changes: 78 additions & 91 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,53 +2,46 @@ name: Publish to Registries

on:
push:
branches:
- main
- master
tags:
- 'v[0-9]+.[0-9]+.[0-9]+'
- 'v[0-9]+.[0-9]+.[0-9]+-*'

permissions:
contents: write
packages: write
id-token: write # Required for OIDC trusted publisher

env:
NODE_VERSION: '20.x'
PNPM_VERSION: '9'

jobs:
build:
name: Build and Test
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [18.x, 20.x, 22.x]

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

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

- name: Install pnpm
uses: pnpm/action-setup@v4
with:
version: ${{ env.PNPM_VERSION }}
run_install: false

- name: Get pnpm store directory
shell: bash
run: |
echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV

- name: Setup pnpm cache
uses: actions/cache@v4
- name: Setup Node.js
uses: actions/setup-node@v6
with:
path: ~/.pnpm-store
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-store-
node-version: '24'
cache: 'pnpm'

- name: Install dependencies
run: pnpm install --frozen-lockfile

- name: Run linting
run: pnpm run lint
continue-on-error: true

- name: Build project
run: pnpm run build

Expand All @@ -57,95 +50,89 @@ jobs:
env:
CI: true

publish:
name: Publish to NPM & GitHub Package Registry
- name: Upload build artifact
uses: actions/upload-artifact@v4
with:
name: dist
path: dist/
retention-days: 1

publish-npm:
name: Publish to NPM
runs-on: ubuntu-latest
needs: build
if: github.event_name == 'push' && (github.ref == 'refs/heads/main' || github.ref == 'refs/heads/master')

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

- name: Check version changes
uses: EndBug/version-check@v2
id: check
with:
file-url: https://unpkg.com/ioserver@latest/package.json
static-checking: localIsNew

- name: Version update detected
if: steps.check.outputs.changed == 'true'
run: echo "Version change found! New version:${{ steps.check.outputs.version }} (${{ steps.check.outputs.type }})"
uses: actions/checkout@v5

- name: Setup Node.js for publishing
if: steps.check.outputs.changed == 'true'
uses: actions/setup-node@v4
- name: Setup Node.js (npm publish)
uses: actions/setup-node@v6
with:
node-version: ${{ env.NODE_VERSION }}
node-version: '24'
registry-url: 'https://registry.npmjs.org'

- name: Install pnpm
if: steps.check.outputs.changed == 'true'
uses: pnpm/action-setup@v4
- name: Download build artifact
uses: actions/download-artifact@v4
with:
version: ${{ env.PNPM_VERSION }}
run_install: false
name: dist
path: dist/

- name: Install dependencies
if: steps.check.outputs.changed == 'true'
run: pnpm install --frozen-lockfile
- name: Publish to npm
run: NODE_AUTH_TOKEN="" npm publish --access public --provenance --ignore-scripts

- name: Build project
if: steps.check.outputs.changed == 'true'
run: pnpm run build
publish-gpr:
name: Publish to GitHub Packages
runs-on: ubuntu-latest
needs: build

- name: Create Git tag
if: steps.check.outputs.changed == 'true'
uses: mathieudutour/[email protected]
with:
custom_tag: ${{ steps.check.outputs.version }}
github_token: ${{ secrets.GITHUB_TOKEN }}
tag_prefix: 'v'
steps:
- name: Checkout repository
uses: actions/checkout@v5

- name: Create GitHub release
if: steps.check.outputs.changed == 'true'
uses: ncipollo/[email protected]
- name: Setup Node.js (GitHub Packages)
uses: actions/setup-node@v6
with:
tag: v${{ steps.check.outputs.version }}
name: Release v${{ steps.check.outputs.version }}
generateReleaseNotes: true
draft: false
prerelease: false
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Publish to NPM
if: steps.check.outputs.changed == 'true'
run: pnpm publish --no-git-checks --access public
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }}
node-version: '24'
registry-url: 'https://npm.pkg.github.com'
scope: '@x42en'

- name: Setup Node.js for GitHub Packages
if: steps.check.outputs.changed == 'true'
uses: actions/setup-node@v4
- name: Download build artifact
uses: actions/download-artifact@v4
with:
node-version: ${{ env.NODE_VERSION }}
registry-url: 'https://npm.pkg.github.com/'
scope: '@x42en'
name: dist
path: dist/

- name: Prepare package for GitHub Packages
if: steps.check.outputs.changed == 'true'
run: pnpm run gpr-setup
run: node scripts/gpr.js

- name: Publish to GitHub Packages
if: steps.check.outputs.changed == 'true'
run: pnpm publish --no-git-checks --access public
run: npm publish --access public --ignore-scripts
env:
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Restore package configuration
if: steps.check.outputs.changed == 'true'
run: pnpm run gpr-restore
if: always()
run: node scripts/gpr-restore.js

github-release:
name: Create GitHub Release
runs-on: ubuntu-latest
needs: [publish-npm, publish-gpr]

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

- name: Create GitHub Release
uses: ncipollo/release-action@v1
with:
tag: ${{ github.ref_name }}
name: Release ${{ github.ref_name }}
generateReleaseNotes: true
draft: false
prerelease: ${{ contains(github.ref_name, '-') }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
10 changes: 4 additions & 6 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
language: node_js
os:
- linux
dist:
- bionic
- focal
node_js:
- "12"
- "14"
- "16"
- "18"
- "20"
- "22"
- "24"
git:
depth: 1
12 changes: 6 additions & 6 deletions TESTING.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# IOServer v2.0.0 Testing Guide
# IOServer v2.1.1 Testing Guide

## 📋 Test Coverage

Expand Down Expand Up @@ -149,9 +149,9 @@ node --expose-gc node_modules/.bin/jest
### Unit Test Template

```typescript
import { IOServer } from "../../src";
import { IOServer } from '../../src';

describe("Component Name", () => {
describe('Component Name', () => {
let component: ComponentType;

beforeEach(() => {
Expand All @@ -162,7 +162,7 @@ describe("Component Name", () => {
// Cleanup
});

it("should perform expected behavior", () => {
it('should perform expected behavior', () => {
// Test implementation
expect(result).toBe(expected);
});
Expand All @@ -172,7 +172,7 @@ describe("Component Name", () => {
### Integration Test Template

```typescript
describe("Feature Integration", () => {
describe('Feature Integration', () => {
let server: IOServer;

beforeAll(async () => {
Expand All @@ -186,7 +186,7 @@ describe("Feature Integration", () => {
await server.stop();
});

it("should integrate components correctly", async () => {
it('should integrate components correctly', async () => {
// Test implementation
});
});
Expand Down
Loading
Loading