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

Generator fix pwa-kit.config template path #357

Merged
merged 3 commits into from
Jan 26, 2022

Conversation

adamraya
Copy link
Collaborator

@adamraya adamraya commented Jan 26, 2022

Description

Fixes the path to obtain the pwa-kit.config template in the pwa-kit-create-app/scripts/create-mobify-app.js script. The template includes the configuration to not include the locale in the URL as part of generating a project with a single-locale.

The previous solution assumed that the create-mobify-app.js script was always run from the root of the monorepo.

Types of Changes

  • Bug fix (non-breaking change that fixes an issue)
  • New feature (non-breaking change that adds functionality)
  • Documentation update
  • Breaking change (could cause existing functionality to not work as expected)
  • Other changes (non-breaking changes that does not fit any of the above)

Breaking changes include:

  • Removing a public function or component or prop
  • Adding a required argument to a function
  • Changing the data type of a function parameter or return value
  • Adding a new peer dependency to package.json

Changes

  • Use require instead of path.join to read the pwa-kit.config template.

How to Test-Drive This PR

  1. Checkout this branch generator-single-locale-fix-path.
  2. Run npm ci.
  3. Generate a project locally from the root of the monorepo by running the create-mobify-app script:
GENERATOR_PRESET=test-project node packages/pwa-kit-create-app/scripts/create-mobify-app-dev.js --outputDir /tmp/project1
  1. Generate a project locally from packages/pwa-kit-create-app by running the create-mobify-app script:
GENERATOR_PRESET=test-project node ./scripts/create-mobify-app-dev.js --outputDir /tmp/project2
  1. Confirm the two resulted generated projects have this URL configuration for the locale type in the pwa-kit.config.js file:
{
  "url": {
    "locale": "none"
  }
}

Checklists

General

  • Changes are covered by test cases
  • CHANGELOG.md updated with a short description of changes (not required for documentation updates)

Accessibility Compliance

You must check off all items in one of the follow two lists:

  • There are no changes to UI

or...

Localization

  • Changes include a UI text update in the Retail React App (which requires translation)

@adamraya adamraya requested a review from a team as a code owner January 26, 2022 18:40
@adamraya adamraya changed the title Generator update pwa-kit.config template path Generator fix pwa-kit.config template path Jan 26, 2022
@vcua-mobify vcua-mobify self-requested a review January 26, 2022 19:14
@vcua-mobify
Copy link
Contributor

+1 LGTM

Thanks for making this change @adamraya

@adamraya adamraya merged commit f18a04e into develop Jan 26, 2022
@adamraya adamraya deleted the generator-single-locale-fix-path branch January 29, 2022 00:53
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.

2 participants