Skip to content

Conversation

@olavoasantos
Copy link
Member

Closes #53

📑 Summary

This pull request introduces the @micra/environment package, 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

  • Added the Environment class in src/classes/Environment.ts, providing methods for managing environment variables, including get, set, unset, define, validate, and fork. The class supports validation, transformation, and inheritance of environment variables.

Testing

  • Added comprehensive unit tests for the Environment class in src/classes/Environment.test.ts, covering all major functionality, including variable management, validation, and serialization.

Configuration and Build

  • Added vite.config.ts for building the package, including support for ES and CommonJS formats, TypeScript declaration generation, and test coverage configuration.
  • Added tsconfig.json with strict TypeScript compiler options and support for module resolution and declaration files.

Documentation

  • Created a README.md file with an overview of the package, installation instructions, and links to documentation and contribution guidelines.
  • Added a typedoc configuration file for generating API documentation in Markdown format.

Performance and Size Limit

  • Added a Benchmark suite in .performance.mjs to measure performance and a size limit configuration in .size-limit.mjs to enforce a maximum bundle size of 13 bytes. [1] [2]

✅ Checks

  • My pull request adheres to the code style of this project
  • My code requires changes to the documentation
  • I have updated the documentation as required
  • All the tests have passed

@olavoasantos olavoasantos added the Type: feat A new feature label Apr 20, 2025
@olavoasantos olavoasantos requested a review from Copilot April 20, 2025 00:35
@olavoasantos olavoasantos self-assigned this Apr 20, 2025
@changeset-bot
Copy link

changeset-bot bot commented Apr 20, 2025

🦋 Changeset detected

Latest commit: a4b92a3

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@micra/environment Minor

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

Copy link

Copilot AI left a 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

@olavoasantos olavoasantos merged commit a7301d8 into latest Apr 20, 2025
1 check passed
@olavoasantos olavoasantos deleted the feat/M1G1P03T02 branch April 20, 2025 00:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Type: feat A new feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

M1G1P03T02 Implement and Test Environment Abstraction

2 participants