Skip to content
Open
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
4 changes: 0 additions & 4 deletions .babelrc

This file was deleted.

118 changes: 93 additions & 25 deletions .github/workflows/project.yml
Original file line number Diff line number Diff line change
@@ -1,34 +1,102 @@
name: Build
name: CI/CD Pipeline

on:
pull_request:
branches: [ "master" ]
branches: ['master']
push:
branches: ['master']

permissions:
contents: write
issues: write
pull-requests: write
id-token: write

jobs:
build:
test:
runs-on: ubuntu-latest
name: Test & Quality Checks

steps:
- uses: actions/checkout@v3

- name: Use Node.js 18.x
uses: actions/setup-node@v3
with:
node-version: 18.x

- name: Install dependencies
run: npm install

- name: Lint
run: npm run lint

- name: Format
run: npm run format:check

- name: Tests
run: npm run unit:all

- name: Build
run: npm run build

- uses: actions/checkout@v4

- name: Setup pnpm
uses: pnpm/action-setup@v4
with:
version: 8

- name: Use Node.js 18.x
uses: actions/setup-node@v4
with:
node-version: 18.x
cache: 'pnpm'

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

- name: Type check
run: pnpm typecheck

- name: Lint
run: pnpm lint

- name: Format check
run: pnpm format:check

- name: Run tests
run: pnpm test:run

- name: Build
run: pnpm build

- name: Upload build artifacts
uses: actions/upload-artifact@v4
with:
name: dist
path: dist/

release:
needs: test
runs-on: ubuntu-latest
if: github.ref == 'refs/heads/master' && github.event_name == 'push'
name: Release & Deploy

steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
token: ${{ secrets.GITHUB_TOKEN }}

- name: Setup pnpm
uses: pnpm/action-setup@v4
with:
version: 8

- name: Use Node.js 18.x
uses: actions/setup-node@v4
with:
node-version: 18.x
cache: 'pnpm'

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

- name: Build
run: pnpm build

- name: Release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
run: pnpm release

- name: Deploy to CDN (Simulation)
if: success()
run: |
echo "🚀 Deploying to CDN..."
echo "Version: $(node -p "require('./package.json').version")"
# In real scenario, this would deploy to actual CDN
echo "Files would be deployed to:"
echo "- https://cdn.ubidots.com/html-canvas/v$(node -p "require('./package.json').version")/"
echo "- https://cdn.ubidots.com/html-canvas/v$(node -p "require('./package.json').version.split('.')[0]")/"
echo "- https://cdn.ubidots.com/html-canvas/latest/"
16 changes: 15 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -62,9 +62,23 @@ typings/

# Omit compiled files
build/
.yarn/
dist/
docs/
.yarn/

# IDE files
.idea
.vscode/
*.swp
*.swo

# TypeScript
*.tsbuildinfo

# Package manager files
.pnp.cjs
.pnp.loader.mjs

# OS files
.DS_Store
Thumbs.db
1 change: 1 addition & 0 deletions .node-version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
24
1 change: 1 addition & 0 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
@ubidots:registry=https://registry.npmjs.org/
2 changes: 1 addition & 1 deletion .prettierrc
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,4 @@
"tabWidth": 2,
"trailingComma": "es5",
"useTabs": false
}
}
22 changes: 22 additions & 0 deletions .releaserc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{
"branches": ["master"],
"plugins": [
"@semantic-release/commit-analyzer",
"@semantic-release/release-notes-generator",
[
"@semantic-release/changelog",
{
"changelogFile": "CHANGELOG.md"
}
],
"@semantic-release/npm",
"@semantic-release/github",
[
"@semantic-release/git",
{
"assets": ["package.json", "CHANGELOG.md"],
"message": "chore(release): ${nextRelease.version} [skip ci]\n\n${nextRelease.notes}"
}
]
]
}
65 changes: 65 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
# Changelog

All notable changes to this project will be documented in this file.

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

## [Unreleased]

### Added

- TypeScript rewrite with strict typing
- Modern pub/sub architecture with EventBus
- Integration with @ubidots/ubidots-javascript-library
- Comprehensive test suite with 126 tests
- Auto-generated documentation with TypeDoc
- Multiple build formats (CJS, ESM, IIFE)
- Error isolation and better error handling
- Type-safe event system
- Widget configuration management

### Changed

- Build system migrated from webpack to tsup
- Package manager changed from yarn to pnpm
- Improved API with getter methods for state access
- Enhanced development workflow with Vitest

### Deprecated

- `getHeader()` method - use `getHeaders()` instead
- Direct property access - use getter methods

### Removed

- Legacy JavaScript build configuration
- Outdated dependencies

## [1.1.0] - 2024-12-15

### Added

- Global type declarations for better IDE support
- Improved code formatting and structure

### Fixed

- Missing newlines in various files
- Code formatting inconsistencies

## [1.0.0] - 2024-06-01

### Added

- Initial stable release
- Basic widget-dashboard communication
- PostMessage API integration
- Support for device selection events
- Date range filtering
- Real-time mode toggle
- Dashboard refresh capabilities

### Security

- Origin validation for PostMessage events
Loading
Loading