{"id":14942,"library":"stonyx","title":"Stonyx Framework Core","description":"Stonyx is an early-stage, TypeScript-first framework module designed for building modular applications, emphasizing a structured, object-oriented approach. It provides foundational concepts such as an `Application` class, `Context` management, and decorators like `@Component` and `@Service`, hinting at a dependency injection pattern. The package is currently in a pre-release state, with version 0.2.2 being the latest stable release, but development is active with frequent `0.2.3-beta` versions being published. This rapid iteration indicates that the API is subject to change and may not be stable. Stonyx aims to provide a robust core for larger application ecosystems, though specific use cases (e.g., web server, CLI tool) are not explicitly detailed in its current minimal documentation.","status":"active","version":"0.2.2","language":"javascript","source_language":"en","source_url":"https://github.com/abofs/stonyx","tags":["javascript"],"install":[{"cmd":"npm install stonyx","lang":"bash","label":"npm"},{"cmd":"yarn add stonyx","lang":"bash","label":"yarn"},{"cmd":"pnpm add stonyx","lang":"bash","label":"pnpm"}],"dependencies":[],"imports":[{"note":"Prefer ESM imports for Stonyx given its modern TypeScript tooling. CommonJS `require` might work for `dist/index.js` but is less idiomatic.","wrong":"const { createApplication } = require('stonyx');","symbol":"createApplication","correct":"import { createApplication } from 'stonyx';"},{"note":"The `Application` class is a named export, not a default export.","wrong":"import Application from 'stonyx';","symbol":"Application","correct":"import { Application } from 'stonyx';"},{"note":"Import specific decorators/classes directly for better tree-shaking and readability.","wrong":"import * as Stonyx from 'stonyx'; const MyService = Stonyx.Service;","symbol":"Service","correct":"import { Service } from 'stonyx';"}],"quickstart":{"code":"import { createApplication, Component, Service } from 'stonyx';\n\ninterface MyConfig { message: string; }\n\n@Component()\nclass MyComponent {\n  constructor(private config: MyConfig) {}\n\n  run() {\n    console.log(`Component running with message: ${this.config.message}`);\n  }\n}\n\n@Service()\nclass MyService {\n  constructor(private myComponent: MyComponent) {}\n\n  start() {\n    console.log('Service starting...');\n    this.myComponent.run();\n  }\n}\n\nasync function bootstrap() {\n  const app = createApplication({\n    components: [MyComponent, MyService],\n    providers: [\n      { provide: 'MyConfig', useValue: { message: 'Hello from Stonyx!' } }\n    ]\n  });\n\n  await app.start();\n  const service = app.resolve(MyService);\n  service.start();\n\n  // In a real app, you might listen for termination signals or keep the process alive\n  // app.stop(); // Example of stopping the application\n}\n\nbootstrap().catch(console.error);","lang":"typescript","description":"This quickstart demonstrates how to initialize a Stonyx application, define a basic component and service using decorators, inject a configuration, and run the service."},"warnings":[{"fix":"Review the GitHub repository's commit history and `src` directory for the latest API changes before upgrading. Regularly check for new beta releases and test thoroughly.","message":"Stonyx is in a very early pre-release stage (0.2.x with frequent beta updates). APIs are not stable and are subject to frequent breaking changes without major version bumps. Always pin exact versions in `package.json`.","severity":"breaking","affected_versions":">=0.2.0"},{"fix":"Explore the `src` directory in the GitHub repository to understand the internal structure and available exports. Pay close attention to `index.ts`, `Application.ts`, `Component.ts`, and `Service.ts` for core patterns.","message":"The documentation for Stonyx is extremely minimal at this stage. Most functionality and intended usage patterns must be inferred directly from the source code. This increases the learning curve and risk of misinterpreting features.","severity":"gotcha","affected_versions":">=0.2.0"},{"fix":"Check the `abofs` GitHub organization for related Stonyx packages that provide integrations or extended functionality. Be prepared to build custom integrations if specific needs are not met by existing modules.","message":"As a 'base framework module', Stonyx likely requires other companion `stonyx-*` packages (e.g., for specific server integrations, plugins) to be fully functional in a real-world application. Without these, its utility might be limited to core application structure.","severity":"gotcha","affected_versions":">=0.2.0"}],"env_vars":null,"last_verified":"2026-04-19T00:00:00.000Z","next_check":"2026-07-18T00:00:00.000Z","problems":[{"fix":"Ensure `createApplication` is used to construct the application instance and that `await app.start()` is called to initialize services and components before attempting to resolve or use them.","cause":"Attempting to call `start()` on an `Application` instance before it has been properly initialized or if the `createApplication` factory function was not used correctly.","error":"TypeError: app.start is not a function"},{"fix":"Verify that all `@Component()` or `@Service()` classes are listed in the `components` array passed to `createApplication`. For non-class dependencies (e.g., config objects), ensure a corresponding `provider` is defined.","cause":"A component or service dependency could not be found or instantiated by the dependency injection container. This often happens if the class was not included in the `components` array during application creation or if a provider is missing for a primitive type.","error":"Error: Cannot resolve dependency: MyService"}],"ecosystem":"npm"}