Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Guess what? More restructuring! * Update workflow paths * Just stuff and things * It kinda does the thing in a way * Buf stuff * Regen stuff * Little tidbits in the TS * Fix lockfile again * Taking the stuff from the other thing * Working on the thing or something. Idfk * Make it all pretty and compilable * Refactor generator test for simplicity The generator test has been simplified by removing the use of a Writable stream. The 'gen' function now directly returns the result, which is then tested for null and emptiness. This change makes the test more straightforward and easier to understand. * Added test command to Makefile A new 'test' command has been added to the Makefile. This allows for running tests directly from the make utility, improving the testing workflow. * Added nested fields to 'test' type The 'test' type in the Generator now supports nested fields. A new field named 'test' of type string has been added under the existing 'test' type. This enhancement provides more flexibility and depth when defining types. * Refactored Makefile for better organization The Makefile has been restructured to improve readability and maintainability. Changes include: - Separated build and test targets into dotnet-specific and package-specific ones - Reordered clean targets for logical consistency - Moved proto-related operations into their own targets with dependencies - Added explicit touch commands to ensure correct timestamp updates on build artifacts * Expanded MIME type support in UML generator The UML generator's read function now supports a wider range of MIME types. A new 'SupportedMimeType' type has been introduced to handle this change. The function will now throw an error for unrecognized media types, improving the robustness of the code. * Updated package.json in UML package The package.json file in the UML package has been updated. The 'module' field was moved under the 'type' field for better organization. Additionally, two new fields were added: 'main', which points to the main JavaScript file, and 'types', which points to the TypeScript definition file. * Added fast-check to devDependencies The package.json file in the UML package has been updated. The main change is the addition of "fast-check" to the list of development dependencies, which will help with property-based testing. * Added test step to build action A new testing step has been added to the GitHub Actions workflow for building. This step runs after the build process and before linting, ensuring that tests are executed as part of the continuous integration pipeline. * Added tests and updated MIME types handling - Introduced new tests for the 'read' function in the UML package, checking its ability to handle different data types. - Refactored SupportedMimeType from a union type to an array constant and derived tuple type. This change enhances code maintainability by centralizing MIME type definitions. * Refactored UML to TypeScript conversion logic The code has been refactored to improve the structure and readability. The main changes include: - Extracted the generation logic into a separate command file. - Introduced an Io interface for better handling of input/output operations. - Simplified index.ts by using a new app function that applies commands. - Created a new program.ts file to handle command-related operations, including options and actions. * Updated dependencies in package.json Added 'fast-check' to the devDependencies in the package.json file. This new dependency will help improve testing capabilities. Also, there's a binary change in bun.lockb file. * Updated MIME type in test cases The MIME type 'application/protobuf' was replaced with 'application/x-protobuf' in the unit tests. This change ensures that our tests are aligned with the correct and updated MIME types. * Refactor IO interface and streamline gen function Significant changes include: - Replaced 'BunFile' with 'ArrayBufferSink' and 'Blob' in the Io interface - Removed check for stdin readability in the gen function - Simplified writing to stdout in the gen function * Added support for protobuf and JSON data Implemented functionality to read protobuf and JSON data in the 'gen' function. This includes creating arbitrary fields and types, converting them into binary or JSON format, and then reading them back. Also added tests to verify this functionality for different mime types of protobuf as well as JSON data. * Updated dependencies in package.json Added 'testcontainers' to the devDependencies in the package.json file. This new dependency will aid in managing test environments. * Add Docker support for uml2ts Introduced Docker support for the uml2ts project. This includes: - A new Makefile to build the Docker image - A .dockerignore file to exclude unnecessary files from the Docker context - A multi-stage Dockerfile that sets up the necessary environment, copies over required files, installs dependencies, and builds the application. * Updated package.json and bun.lockb Removed 'src/*' from the workspaces array in package.json. Also, updated the binary file bun.lockb. * Refactor IO handling in uml2ts package Significant changes include: - Removed the Io interface and its usage from command.ts and program.ts - Directly used Bun's stdin and stdout for buffer reading and writing in gen function - Simplified action call in gen command by removing io() argument * Added Makefile and updated package.json A new Makefile has been added to the uml2ts package, introducing build, test, clean, and docker commands. The package.json file in the same package has also been updated with a removal of the "prestart" script. * Updated Docker build process The Docker build process has been updated to include a new test target. This change introduces a new 'uml2ts_test' target in the Makefile, which builds a Docker image for testing purposes. Additionally, the Dockerfile now includes an extra stage that uses Ubuntu as its base image for this test build. * Added test_image target to Makefile A new target, 'test_image', has been added to the Makefile. This allows for the creation of a test image using the existing docker setup. * Updated Dockerfile for uml2ts The Dockerfile for uml2ts has been updated to include a build platform argument. The base image for the test stage has also been changed to a specific version of Ubuntu, and the final stage now includes an alias. * Updated test setup and command execution The testing setup has been updated to include a `beforeAll` block that builds the necessary binary file for tests. The way commands are executed in tests has also been changed, replacing the previous IO-based approach with spawning processes. This change simplifies the code and makes it easier to manage input/output streams. In addition, there's a minor refactor in how commands are applied in the main application logic, making it more functional by passing root as a function instead of an object. * Refactor test setup and simplify tests The test setup has been refactored to ensure a clean environment before each run. The 'Field' and 'Type' imports have been removed, as well as the corresponding arbitrary generators. Tests have been simplified by removing the use of fast-check library and instead using static values for testing. An 'afterAll' cleanup function has also been added to remove any residual files after tests are completed. * Fixes * More fixes * Format * And some more
- Loading branch information