Skip to content
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

feat: pull languages cmd #129

Merged
merged 10 commits into from
Nov 5, 2024
Merged

feat: pull languages cmd #129

merged 10 commits into from
Nov 5, 2024

Conversation

alvarosabu
Copy link
Contributor

@alvarosabu alvarosabu commented Oct 31, 2024

Hi, this is the new implementation of the pull-components command for the renovated version of the CLI.

  • Bugfix
  • Feature
  • Code style update (formatting, renaming)
  • Refactoring (no functional changes, no api changes)
  • Other (please describe):

How to test this PR

  1. Clone the repo and pull the branch
  2. Add several languages to a Storyblok Space or use the default test one 295017 or 295018
  3. Run pnpm install
  4. Run pnpm run dev pull-languages --space <SPACE_ID>

Testing checklist

  • pull languages with a space with languages configured.
    • should create a languages.295017.json file on the root containing an object
    {
      "languages": [
        {
          "code": "de",
          "name": "German"
        },
        {
          "code": "ja",
          "name": "Japanese"
        },
        {
          "code": "pl",
          "name": "Polish"
        }
      ]
    }
    • file should contain "default_lang_name": "en", if configured on the space
    • should prompt an error if flag space is missing Please provide the space as argument --space YOUR_SPACE_ID.
    • should prompt an API error if the space ID is incorrect
    • should prompt an unauthorized error if the user is not logged in before operating this command

@alvarosabu alvarosabu added the p3-significant [Priority] Moderate issues, major enhancements label Oct 31, 2024
@alvarosabu alvarosabu self-assigned this Oct 31, 2024
@alvarosabu alvarosabu marked this pull request as draft October 31, 2024 10:30
@alvarosabu alvarosabu added the needs-test [PR] requiring additional tests label Oct 31, 2024
@alvarosabu alvarosabu removed the needs-test [PR] requiring additional tests label Oct 31, 2024
@alvarosabu alvarosabu marked this pull request as ready for review October 31, 2024 14:41
Copy link
Contributor

@edodusi edodusi left a comment

Choose a reason for hiding this comment

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

Adding some code comments, proceeding to manual testing!

src/commands/pull-languages/actions.ts Show resolved Hide resolved
src/commands/pull-languages/actions.ts Show resolved Hide resolved
src/commands/pull-languages/index.ts Outdated Show resolved Hide resolved
@edodusi
Copy link
Contributor

edodusi commented Nov 4, 2024

@alvarosabu I manually tested and checked everything 🚀

One thing, the steps you provided mention that I should have "default_lang_name": "en", in the json file, while I have "default_lang_name": "english",, is this correct?

@alvarosabu
Copy link
Contributor Author

alvarosabu commented Nov 4, 2024

@alvarosabu I manually tested and checked everything 🚀

One thing, the steps you provided mention that I should have "default_lang_name": "en", in the json file, while I have "default_lang_name": "english",, is this correct?

Awesome, thanks for testing it.

Thats weird. My JSON looks like this:

{
  "default_lang_name": "en",
  "languages": [
    {
      "code": "de",
      "name": "German"
    },
    {
      "code": "ja",
      "name": "Japanese"
    },
    {
      "code": "pl",
      "name": "Polish"
    }
  ]
}

@edodusi Which space are you using? Send me via Slack

Copy link
Contributor

@edodusi edodusi left a comment

Choose a reason for hiding this comment

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

👍

@alvarosabu alvarosabu merged commit 4e52b6b into next Nov 5, 2024
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
p3-significant [Priority] Moderate issues, major enhancements
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants