-
Notifications
You must be signed in to change notification settings - Fork 0
Implement and Test Environment Abstraction #109
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
🦋 Changeset detectedLatest commit: a4b92a3 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This pull request implements an Environment API for the Micra framework, allowing for consistent management, validation, and transformation of environment variables while also introducing comprehensive tests and build configurations.
- Adds the Environment class with methods for getting, setting, defining, validating, and forking environment variables
- Introduces unit tests for the Environment class and configuration files for building the package, generating documentation, performance benchmarking, and enforcing bundle size limits
Reviewed Changes
Copilot reviewed 11 out of 14 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| packages/environment/vite.config.ts | Build, test, and declaration configuration for the package |
| packages/environment/src/index.ts | Minimal module export to set up the package |
| packages/environment/src/classes/Environment.ts | Core implementation of the Environment class with validation, transformation, and event handling |
| packages/environment/src/classes/Environment.test.ts | Unit tests covering Environment functionality |
| packages/environment/README.md | Package documentation and usage guidelines |
| packages/environment/.typedoc.mjs | Typedoc configuration for generating API documentation |
| packages/environment/.size-limit.mjs | Configuration enforcing a maximum bundle size |
| packages/environment/.performance.mjs | Performance benchmark suite for the environment package |
| .performance.mjs | Aggregation of performance benchmarks for multiple packages |
| .changeset/neat-baboons-push.md | Changeset declaring the new Environment API feature and version bump |
Files not reviewed (3)
- packages/environment/package.json: Language not supported
- packages/environment/tsconfig.json: Language not supported
- pnpm-lock.yaml: Language not supported
📑 Summary
This pull request introduces the
@micra/environmentpackage, implementing a robust Environment API for the Micra framework. It includes the core class implementation, testing, configuration files, and documentation. Below is a summary of the most important changes:Core Implementation
Environmentclass insrc/classes/Environment.ts, providing methods for managing environment variables, includingget,set,unset,define,validate, andfork. The class supports validation, transformation, and inheritance of environment variables.Testing
Environmentclass insrc/classes/Environment.test.ts, covering all major functionality, including variable management, validation, and serialization.Configuration and Build
vite.config.tsfor building the package, including support for ES and CommonJS formats, TypeScript declaration generation, and test coverage configuration.tsconfig.jsonwith strict TypeScript compiler options and support for module resolution and declaration files.Documentation
README.mdfile with an overview of the package, installation instructions, and links to documentation and contribution guidelines.typedocconfiguration file for generating API documentation in Markdown format.Performance and Size Limit
Benchmarksuite in.performance.mjsto measure performance and a size limit configuration in.size-limit.mjsto enforce a maximum bundle size of 13 bytes. [1] [2]✅ Checks