Skip to content

Conversation

@jaerod95
Copy link
Contributor

@jaerod95 jaerod95 commented Apr 18, 2025

Overview

This PR includes all of the v5 beta releases, through 5.0.0-beta.8. It has an updated README and the version has been updated to 5.0.0.

Once this PR is merged to master, we will publish the update as the latest stable version, coming out of Beta.

Review Checklist

  • Verify the package.json has the correct version
  • Read through the README - everything look good? All links valid? Anything missing?
  • Pull it down and sanity check the pull command, including using the latest components feature

jaerod95 and others added 30 commits April 8, 2025 08:47
* Moves Legacy CLI into a `legacy` folder and provides a new entrypoint to the beta CLI

- adds a `--legacy (-l)` CLI option that forces the application to run in legacy mode.
- adds a new warning message when the CLI is run in legacy mode.

* Update lib/legacy/index.ts

Co-authored-by: Marla Hoggard <[email protected]>

---------

Co-authored-by: Marla Hoggard <[email protected]>
* Moves Legacy CLI into a `legacy` folder and provides a new entrypoint to the beta CLI

- adds a `--legacy (-l)` CLI option that forces the application to run in legacy mode.
- adds a new warning message when the CLI is run in legacy mode.

* Update lib/legacy/index.ts

Co-authored-by: Marla Hoggard <[email protected]>

* Cleanup build scripts and upgrade typescript and esbuild (#114)

* Modernize build system and upgrade esbuild and typescript

- Additionally removes the v8-compile-cache that provides little value in modern node applications of this size.
- Adds minification support via esbuild as well as cleaner map files.
- Updates package.json "files" property to now only ship required files to npm.

---------

Co-authored-by: Marla Hoggard <[email protected]>
* Moves Legacy CLI into a `legacy` folder and provides a new entrypoint to the beta CLI

- adds a `--legacy (-l)` CLI option that forces the application to run in legacy mode.
- adds a new warning message when the CLI is run in legacy mode.

* Modernize build system and upgrade esbuild and typescript

- Additionally removes the v8-compile-cache that provides little value in modern node applications of this size.
- Adds minification support via esbuild as well as cleaner map files.
- Updates package.json "files" property to now only ship required files to npm.

* Add CONTRIBUTING.md file with guidelines for getting started with the CLI code

* Adds IS_LOCAL flag for improved debugging experience in beta CLI

* Adds support for fetching and saving API tokens via the beta cli.

* Remove CONTRIBUTING.md file as part of project restructuring.

* Cleanup file structure and prepare for tests

* Introduce basic pull command

* Full implementation of generating basic i18Next File

* Enhance I18NextFormatter to conditionally generate driver files based on configuration. Update error handling in handleOutput to provide clearer output format messages. Add default value for generateDriverFile in ZI18NextOutput schema.

* Add support for json formats with frameworks

* Address PR feedback

* Add documentation for generateImportStatements method in I18NextFramework class

* Update GitHub Actions to use latest versions of actions/cache, actions/checkout, and actions/setup-node

* Update GitHub Actions workflow to use Ubuntu 24.04 for testing environment

* Remove obsolete test files for JSON and configuration services

* Refactor API token handling and HTTP client configuration. Introduce default interceptor for axios requests and update token validation logic to improve error handling and context management.

* add comments and small nit changes

* Update lib/src/services/projectConfig.ts

Co-authored-by: Marla Hoggard <[email protected]>

* Update lib/src/http/client.ts

Co-authored-by: Marla Hoggard <[email protected]>

* Update lib/src/http/checkToken.ts

Co-authored-by: Marla Hoggard <[email protected]>

* Remove default data parameter from readGlobalConfigData function and return an empty object if parsing fails.

* Update lib/src/http/checkToken.ts

Co-authored-by: Marla Hoggard <[email protected]>

* Refactor JSONFormatter to include a new line for improved readability and update fetchText function to stringify filters in API request parameters.

* Refactor JSONFormatter to use a variable for filename construction, improving code clarity and maintainability.

---------

Co-authored-by: Marla Hoggard <[email protected]>
…pdate debug condition in error logging. Use a predefined list of keys for production environment variables and change the local debug check from IS_LOCAL to DEBUG.
#117)

* Refactor CLI command handling and project configuration

- Introduced a new `--config` flag for the `pull` command to specify the project config file path.
- Updated `initProjectConfig` to accept options for configuration.
- Enhanced `executeCommand` to handle command options more effectively.
- Adjusted output directory handling in JSONFormatter for improved flexibility.
- Added `outDir` to output filters in shared outputs for better configuration management.

* Enhance file writing functions to create missing directories

- Updated `writeFileSync` and `writeFile` functions to check for the existence of the target directory and create it recursively if it does not exist. This ensures that files can be written without errors related to missing directories.

* Refactor JSON framework handling and enhance JSONFormatter

- Moved framework processor logic to a new `json` directory for better organization.
- Updated `JSONFormatter` to utilize the new `getFrameworkProcessor` function from the JSON framework.
- Removed obsolete base framework and index files, streamlining the framework structure.
- Introduced `BaseFramework` and `I18NextFramework` classes to handle specific framework processing.
- Enhanced output directory handling in `BaseFormatter` for improved configuration management.

* Refactor JSON framework handling and update framework processor logic

- Updated `JSONFormatter` to correctly process the framework output.
- Removed obsolete imports and files related to the i18next framework.
- Simplified framework type handling in the framework processor.
- Enhanced Zod schema for JSON output to directly specify the framework type.

* Refactor output handling and improve configuration management

- Simplified the `format` method in `BaseFormatter` and `JSONFormatter` by removing unnecessary parameters.
- Updated output directory handling in `BaseFormatter` and `AppContext` for better consistency and clarity.
- Enhanced the `outDir` retrieval logic in `AppContext` to prioritize project configuration settings.
* Refactor output directory handling and enhance module type support in JSON formatters

- Updated `JSONFormatter` and `BaseFramework` to use `outDir` instead of `outputDir` for improved consistency.
- Introduced module type handling in `I18NextFramework` to support both CommonJS and ES module formats.
- Added methods for generating require statements and module exports to streamline output generation.
- Enhanced Zod schema for JSON output to include optional module type specification.

* Suggestions from review:
- Add docstring comments to codegen methods
- Add type to some additional docstring comments
- Rename one codegen method
- Add named require method

---------

Co-authored-by: Marla Hoggard <[email protected]>
* Better error messaging for config errors

* Create DittoError

* Use zods error flattening

* Enhance Zod schemas for JSON outputs by enforcing strict mode in base output definitions

* Use errorText in sentry

---------

Co-authored-by: [email protected] <[email protected]>
…authentication, and usage details for the Ditto CLI v5.
…the shorthand '-l' option alongside the '--legacy' flag.
asnewman and others added 20 commits August 12, 2025 16:06
Updates createMockTextItem function to use Partial<TextItemsResponse[0]>
instead of any, providing better type safety for test mock overrides.
Improves test organization by moving testDir, outputDir variables
and beforeEach/afterEach hooks inside the main describe block for
better scoping and isolation.
Replaces mutating sort() calls with non-mutating toSorted()
to avoid potential side effects in test assertions.
These tests mock HTTP calls and set appContext directly, so the YAML
config files were never actually read. Removed the duplication between
YAML strings and setProjectConfig() calls - now tests only create what
they need and use a single source of truth for configuration.

This eliminates the risk of YAML/object mismatch bugs and makes the
tests clearer about what they're actually testing.
Adds toHaveBeenCalledWith assertions to filter tests to verify that
config filters are correctly converted to API query parameters.
Tests now catch bugs in the config->API params conversion logic
instead of just testing the mocked response->file output flow.

This addresses the concern that filter tests weren't actually
testing the filtering functionality due to complete API mocking.
* Add support for fetching components from API for JSON output
* clean up logs, basic test
* make folders optional, add tests
* split up filter rode, clean up error logging
* support nested folder specification
* upgrade to beta 8 version
@marla-hoggard marla-hoggard force-pushed the v5-beta branch 3 times, most recently from f3c6b90 to a7af95d Compare October 1, 2025 16:29
Copy link

@JWhite30515 JWhite30515 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Latest README LGTM! verified all links work

@marla-hoggard marla-hoggard merged commit d6a5460 into master Oct 1, 2025
1 check passed
@marla-hoggard marla-hoggard deleted the v5-beta branch October 6, 2025 14:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants