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

v1.12 #247

Merged
merged 13 commits into from
Aug 24, 2021
Merged

v1.12 #247

merged 13 commits into from
Aug 24, 2021

Conversation

oshi97
Copy link
Contributor

@oshi97 oshi97 commented Aug 24, 2021

tmeyer2115 and others added 13 commits May 19, 2021 16:12
This PR adds a check to the `babel` helper to see if we are currently in the Development Mode. If
so, the enclosed source code is not run through Babel, it is returned verbatim. This is a preview
optimization, since the Babel-ification is a relatively slow operation. It's not necessary for
preview either, assuming devs are not previewing their changes in IE11.

J=SLAP-1312
TEST=manual

Ensured that when in Development mode, the helper was a simple pass-through. In Production mode,
the enclosed code was Babel-ified.
This PR removes the sample site that was included with Jambo. This sample is very much out of date. It was
created at Jambo's inception. The Hitchhiker Training and Theme provide much better guidance on how to
use Jambo.

J=SLAP-1239
TEST=none
This commit refactors jambo's logging to use npmlog,
which is the logger used by npm (surprise!).
It adds a magenta 'jambo' log heading to differentiate it from
npm, which uses a white on black 'npm' heading.

J=SLAP-226
TEST=manual

test a regular jambo build
test jambo build when it throws an error because there's no jambo.json
test jambo page that is missing required arguments
test the custom card command in the theme
see that the tested logs look as expected, and contain the same information as before
jambo help prints normally
jambo version prints normally
warning is given if custom command is malformatted

test that you can set the npmlog log level anywhere, and that log level will be reflected globally
in the future we can let jambo set different log levels or even silence logging
* Add Jambo build validation hook

- Added another operation inside PageWriter to ensure template data is correct
using TemplateDataValidator, which pass in the templateArgument to the theme's validation
hook function if it exists. Throw error if theme's hook function return false indicating bad 
template data.

J=SLAP-1369
TEST=auto

Passed Jest test using default config format with/without missing field when
pass to validation hook

Co-authored-by: Yen Truong <ytruong@yext.com>
* Created Jambo Describe Acceptance Test.

J=SLAP-1305
TEST=auto

Tested the acceptance test by running it from terminal.

* fixed eslint issues

* fixed toms mistake

* fixed some styling issues and removed the inside of the execute function

* moved process.env.IS_DEVELOPMENT_PREVIEW and changed test name
This commit adds acceptance framework improvements needed to
add acceptance tests for the following PR, which will add
--globs as an argument to the extract-translations command.

- adds globalSetup/globalTeardown to jest, which will do one time setup
  for the test-themes. Trying to do it in runPlayground() caused issues
  where different jest test instances would try to perform git operations
  on the same test theme and clobber each other. This is preferable to
  running tests serially with --runInBand
- sets jambo's log level to 'silent' for acceptance tests, because its noisy
  by default
- add procrastinateCleanup flag to runInPlayground for debugging

J=SLAP-1378
TEST=auto

reran tests
* Added custom command acceptance test.
J=1304
TEST=auto

* fixed spacing

* added word 'file' to comment

* removed console.log = jest.fn();
This commit updates the extract-translations command
to take in a --globs argument.
The TranslationExtractor was refactored to only take in
a glob, instead of taking in arrays of files, directories,
and ignored files. The logic of creating an array of globs
by reading from the jambo.json and gitignore files has
been moved into the DefaultTranslationGlobber.

simple-git was updated from 1.131 to 2.40 to remove git
ENOENT errors during acceptance tests. There were improvements
to how simple-git performs git operations in parallel after v2.
We only use simple-git for very basic operations like cloning,
init-ing, and checking out submodules, staging files, and committing,
so there shouldn't be any issues with upgrading. The only breaking
changes in v2.0.0 are git.log using strict ISO by default, and changes
to methods that being with underscores (aka private methods).

J=SLAP-1378
TEST=manual,auto

run jambo extract-translations in the theme, and also in campbells-ca
see messages.pot generated as expected

add acceptance + unit tests
Changed upgrade functionality, so that now it reverts to old theme files when it errors out.

J=SLAP-1308
TEST=manual/automatic

Tested by running jambo upgrade on the hitchhiker theme and making sure that upgrade ran unchanged when no error occurs. Also ran with an artificial error to make sure that theme files are reverted correctly.

Created acceptance test for themeupgrader that checks to make sure that when jambo upgrade errors out, the test-theme remains unchanged.
Created locale fallback acceptance test

- created a new test-theme folder `locale-fallback` with locale_config.json that contains 3 locales: en (default locale), fr (locale fallback for es), and es.
- 'locale-fallback' acceptance test: use `locale-fallback` theme and create an index page for en and es, `index.html.hbs` and `index.fr.html.hbs,` using two different templates. When executing jambo page command for en index page, also create a pageConfig for es with the flag `--locales es`. See that es index page fall back on the pageTemplate and config file for fr.

J=SLAP-1303
TEST=auto

Set `procrastinateCleanup` to true when running the test. See that in the playground folder, the expected config files, pageTemplates, and public html files are build as expected for en, es, and fr. See that acceptance test passed
I will cut a beta version if this is merged in,
so that the theme's CI can work properly.

J=SLAP-1489
TEST=manual

ran builds in the theme, saw that the partials can be used to validate things
J=SLAP-1526
TEST=auto,manual

unit tests
ran build with zh-hans-ch in locale config, saw that the generated source code used the correct locale in the page
tried building a page with a locale with >3 sections, got a jambo warning but build continued without changing the locale
@coveralls
Copy link

Coverage Status

Coverage increased (+1.3%) to 47.686% when pulling a2464bb on release/v1.12 into 08570c2 on master.

Copy link
Contributor

@yen-tt yen-tt left a comment

Choose a reason for hiding this comment

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

maybe include in the description that we added --globs param to extract-translations cmd as well. lgtm!

@oshi97
Copy link
Contributor Author

oshi97 commented Aug 24, 2021

maybe include in the description that we added --globs param to extract-translations cmd as well. lgtm!

updated!

@oshi97 oshi97 merged commit d422b44 into master Aug 24, 2021
@oshi97 oshi97 deleted the release/v1.12 branch August 24, 2021 15:54
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