Skip to content

Commit

Permalink
Merge branch 'develop' into hotfix/v1.8.4
Browse files Browse the repository at this point in the history
  • Loading branch information
tmeyer2115 committed Jun 10, 2021
2 parents a366b7f + 49b6d0f commit c51dd2a
Show file tree
Hide file tree
Showing 368 changed files with 89,654 additions and 10,905 deletions.
18 changes: 18 additions & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"extends": ["semistandard"],
"ignorePatterns": ["dist", "docs"],
"globals": {
"beforeEach": true,
"beforeAll": true,
"describe": true,
"it": true,
"expect": true,
"jest": true,
"DOMParser": true,
"ytag": true,
"test": true,
"fixture": true,
"CustomEvent": true,
"ANSWERS": true
}
}
31 changes: 31 additions & 0 deletions .github/workflows/coverage.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# This workflow will run our tests, generate an lcov code coverage file,
# and send that coverage to Coveralls

name: Code Coverage

on:
push:
branches-ignore: dev/*
pull_request:

jobs:
Coveralls:
runs-on: ubuntu-latest

strategy:
matrix:
node-version: [14.x]

steps:
- uses: actions/checkout@v2
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
- run: npm ci
- run: npx gulp templates
- run: npx jest --coverage
- name: Coveralls
uses: coverallsapp/github-action@master
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
31 changes: 31 additions & 0 deletions .github/workflows/npm_publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: NPM publish on new release

on:
release:
types: [created]
branches:
- master

jobs:
npm-publish:

runs-on: ubuntu-latest

strategy:
matrix:
node-version: [15.x]

steps:
- uses: actions/checkout@v2
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v2
with:
node-version: ${{ matrix.node-version }}
registry-url: https://registry.npmjs.org/
- run: npm ci
- run: npm run build
- run: npm run prepublishOnly
- run: npm publish
- run: npm run postpublish
env:
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}
2 changes: 0 additions & 2 deletions .npmignore

This file was deleted.

8 changes: 7 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# Answers Search UI
Outline:

<h3>
<a href='https://coveralls.io/github/yext/answers-search-ui?branch=master'>
<img src='https://coveralls.io/repos/github/yext/answers-search-ui/badge.svg?branch=master' alt='Coverage Status' />
</a>
</h3>

1. [Install / Setup](#install-and-setup)
2. [ANSWERS.init Configuration Options](#answersinit-configuration-options)
- [Vertical Pages Configuration](#vertical-pages-configuration)
Expand Down
1 change: 1 addition & 0 deletions conf/gulp-tasks/library.gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ const { series, parallel, src, dest, watch } = require('gulp');
const path = require('path');
const postcss = require('gulp-postcss');
const sass = require('gulp-sass');
sass.compiler = require('sass');

const getLibraryVersion = require('./utils/libversion');
const { BundleType, BundleTaskFactory } = require('./bundle/bundletaskfactory');
Expand Down
2 changes: 1 addition & 1 deletion conf/gulp-tasks/template/bundletemplatestaskfactory.js
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ class BundleTemplatesTaskFactory {
plugins: [
'@babel/syntax-dynamic-import',
['@babel/plugin-transform-runtime', {
'corejs': 3
corejs: 3
}],
'@babel/plugin-transform-arrow-functions',
'@babel/plugin-proposal-object-rest-spread',
Expand Down
2 changes: 1 addition & 1 deletion conf/gulp-tasks/template/createcleanfiles.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ function createCleanFilesTask (locale) {
*/
function _cleanFiles (callback, locale) {
const precompiledFile = getPrecompiledFileName(locale);
del.sync([ `./dist/${precompiledFile}` ]);
del.sync([`./dist/${precompiledFile}`]);
callback();
}

Expand Down
8 changes: 4 additions & 4 deletions conf/gulp-tasks/template/createprecompiletemplates.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ function precompileTemplates (callback, outputFile, processAST) {
processPartialName: function (fileName, a, b, c) {
// Strip the extension and the underscore
// Escape the output with JSON.stringify
let name = fileName.split('.')[0];
const name = fileName.split('.')[0];
if (name.charAt(0) === '_') {
return JSON.stringify(name.substr(1));
} else {
Expand All @@ -64,8 +64,8 @@ function precompileTemplates (callback, outputFile, processAST) {
// TBH, this isn't really needed anymore since we don't name files like so 'foo.bar.js', but this is here to
// support that use case.
customContext: function (fileName) {
let name = fileName.split('.')[0];
let keys = name.split('.');
const name = fileName.split('.')[0];
const keys = name.split('.');
let context = 'context';
for (let i = 0; i < keys.length; i++) {
context = context += '["' + keys[i] + '"]';
Expand All @@ -78,7 +78,7 @@ function precompileTemplates (callback, outputFile, processAST) {
root: 'context',
noRedeclare: true,
processName: function (filePath) {
let path = filePath.replace('src/ui/templates', '');
const path = filePath.replace('src/ui/templates', '');
return declare.processNameByPath(path, '').replace('.', '/');
}
}))
Expand Down
12 changes: 6 additions & 6 deletions conf/i18n/constants.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ exports.TRANSLATION_FLAGGER_REGEX = /TranslationFlagger.flag\((\s)*\{[^;]+?\}(\s
exports.DEFAULT_LOCALE = 'en';

const LANGUAGES_TO_LOCALES = {
'en': [
en: [
'en_AE',
'en_AI',
'en_AS',
Expand Down Expand Up @@ -65,7 +65,7 @@ const LANGUAGES_TO_LOCALES = {
'en_US',
'en_ZA'
],
'es': [
es: [
'es_BO',
'es_CO',
'es_CU',
Expand All @@ -77,7 +77,7 @@ const LANGUAGES_TO_LOCALES = {
'es_NI',
'es_US'
],
'fr': [
fr: [
'fr_BE',
'fr_BL',
'fr_CA',
Expand All @@ -89,18 +89,18 @@ const LANGUAGES_TO_LOCALES = {
'fr_MC',
'fr_RE'
],
'it': [
it: [
'it_CH',
'it_IT'
],
'de': [
de: [
'de_AT',
'de_CH',
'de_DE',
'de_EU',
'de_LU'
],
'ja': [
ja: [
'ja_JP'
]
};
Expand Down
2 changes: 1 addition & 1 deletion conf/i18n/runtimecallgeneratorutils.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,6 @@ function formatPluralForms (translatorResult) {
* @returns {string}
*/
function escapeSingleQuotes (str) {
const regex = new RegExp('\'', 'g');
const regex = /'/g;
return str.replace(regex, '\\\'');
}
2 changes: 1 addition & 1 deletion conf/i18n/translatehelpervisitor.js
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ class TranslateHelperVisitor {
...statement,
path: {
...statement.path,
parts: [ this._processTranslationHelper ],
parts: [this._processTranslationHelper],
original: this._processTranslationHelper
}
};
Expand Down
2 changes: 1 addition & 1 deletion conf/i18n/translator.js
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ class Translator {
const placeholders = {};
let placeholderMatch;

const placeholderRegex = new RegExp(/\[\[([a-zA-Z0-9]+)\]\]/, 'g');
const placeholderRegex = /\[\[([a-zA-Z0-9]+)\]\]/g;
while ((placeholderMatch = placeholderRegex.exec(phrase)) != null) {
if (placeholderMatch.length >= 2) {
placeholders[placeholderMatch[1]] = placeholderMatch[0];
Expand Down

0 comments on commit c51dd2a

Please sign in to comment.