@new-born-town/aippy-runtime
v0.1.0
Published
Aippy Runtime SDK - Runtime SDK for Aippy projects
Readme
@new-born-town/aippy-runtime
Runtime SDK for Aippy projects providing device functionality, platform detection, and utility functions.
Installation
npm install @new-born-town/aippy-runtimeUsage
Core
import { AippyConfig, mergeConfig } from '@new-born-town/aippy-runtime/core';
const config = mergeConfig({
debug: true,
apiBaseUrl: 'https://api.example.com'
});Device APIs
import { camera, geolocation, sensors, fileSystem } from '@new-born-town/aippy-runtime/device';
// Camera
const stream = await camera.getStream();
const photo = await camera.capturePhoto({ quality: 'high' });
// Geolocation
const position = await geolocation.getCurrentPosition();
const watchId = geolocation.watchPosition((pos) => {
console.log('Position:', pos);
});
// Sensors
const orientation = await sensors.getOrientation();
const cleanup = sensors.watchOrientation((data) => {
console.log('Orientation:', data);
});
// File System
const files = await fileSystem.openFile({ multiple: true });
await fileSystem.saveFile(blob, 'filename.txt');Utils
import { platform, performanceMonitor, pwa } from '@new-born-town/aippy-runtime/utils';
// Platform detection
const info = platform.getPlatformInfo();
const capabilities = platform.getCapabilities();
// Performance monitoring
const metrics = await performanceMonitor.getCoreWebVitals();
const timing = performanceMonitor.getNavigationTiming();
// PWA utilities
const pwaInfo = pwa.getPWAInfo();
await pwa.registerServiceWorker('/sw.js');
await pwa.sendNotification('Hello!');Packages
@new-born-town/aippy-runtime/core- Core types and configuration@new-born-town/aippy-runtime/device- Device APIs (camera, geolocation, sensors, file system)@new-born-town/aippy-runtime/utils- Platform detection, performance monitoring, PWA utilities
Publishing
This package is published to the npm public registry. The build process ensures that only compiled JavaScript files and TypeScript declarations are included in the published package - no source code is exposed.
Build Process
- Compiles TypeScript to JavaScript
- Generates TypeScript declaration files
- Removes source maps to protect source code
- Only includes
dist/directory andREADME.mdin the published package
Development
# Install dependencies
pnpm install
# Build
pnpm run build
# Type check
pnpm run type-check
# Lint
pnpm run lint
# Format
pnpm run format
# Publish (for maintainers)
pnpm run publish:patch # 0.0.0 -> 0.0.1
pnpm run publish:minor # 0.0.0 -> 0.1.0
pnpm run publish:major # 0.0.0 -> 1.0.0Support
- Homepage: https://aippy.ai
- Support: Discord Community
License
UNLICENSED - This is a proprietary SDK. All rights reserved.
