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

fix exports to work from importing app #49

Merged
merged 3 commits into from
Sep 24, 2020
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/__tests__/tn-table-row-check.test.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* eslint-env jest */

import checkTN_TSVDataRow from '../core/tn-table-row-check';
import {checkTN_TSVDataRow} from '../core/tn-table-row-check';
import Path from "path";
import fs from 'fs-extra';

Expand Down
2 changes: 1 addition & 1 deletion src/core/BCS-usfm-grammar-check.js
Original file line number Diff line number Diff line change
Expand Up @@ -188,4 +188,4 @@ export function checkUSFMGrammar(bookID, strictnessString, filename, givenText,
// end of checkUSFMGrammar function


export default checkUSFMGrammar;
//export default checkUSFMGrammar;
14 changes: 7 additions & 7 deletions src/core/annotation-row-check.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import * as books from './books/books';
import checkTextField from './field-text-check';
import checkMarkdownText from './markdown-text-check';
import checkTAReference from './ta-reference-check';
import checkTNLinks from './tn-links-check';
import checkOriginalLanguageQuote from './quote-check';
import {checkTextField} from './field-text-check';
import {checkMarkdownText} from './markdown-text-check';
import {checkTAReference} from './ta-reference-check';
import {checkTNLinks} from './tn-links-check';
import {checkOriginalLanguageQuote} from './quote-check';


// const ANNOTATION_TABLE_ROW_VALIDATOR_VERSION_STRING = '0.4.1';
Expand All @@ -14,7 +14,7 @@ const EXPECTED_TN_HEADING_LINE = 'Reference\tID\tTags\tSupportReference\tQuote\t
const DEFAULT_EXTRACT_LENGTH = 10;


async function checkAnnotationTSVDataRow(languageCode, annotationType, line, bookID, C, V, givenRowLocation, optionalCheckingOptions) {
export async function checkAnnotationTSVDataRow(languageCode, annotationType, line, bookID, C, V, givenRowLocation, optionalCheckingOptions) {
/**
* @description - Checks one TSV data row of translation notes (TN)
* @param {String} annotationType - TN, TQ, TWL, SN, or SQ -- allows more specific checks
Expand Down Expand Up @@ -418,4 +418,4 @@ async function checkAnnotationTSVDataRow(languageCode, annotationType, line, boo
}
// end of checkAnnotationTSVDataRow function

export default checkAnnotationTSVDataRow;
//export default checkAnnotationTSVDataRow;
6 changes: 3 additions & 3 deletions src/core/annotation-table-check.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import * as books from './books/books';
import checkAnnotationTSVDataRow from './annotation-row-check';
import {checkAnnotationTSVDataRow} from './annotation-row-check';


const ANNOTATION_TABLE_VALIDATOR_VERSION_STRING = '0.2.3';
Expand All @@ -10,7 +10,7 @@ const EXPECTED_TN_HEADING_LINE = 'Reference\tID\tTags\tSupportReference\tQuote\t
const DEFAULT_EXTRACT_LENGTH = 10;


async function CheckAnnotationRows(languageCode, annotationType, bookID, filename, tableText, givenLocation, optionalCheckingOptions) {
export async function CheckAnnotationRows(languageCode, annotationType, bookID, filename, tableText, givenLocation, optionalCheckingOptions) {
/* This function is optimised for checking the entire file, i.e., all rows.

It also has the advantage of being able to compare one row with the previous one.
Expand Down Expand Up @@ -188,4 +188,4 @@ async function CheckAnnotationRows(languageCode, annotationType, bookID, filenam
// end of CheckAnnotationRows function


export default CheckAnnotationRows;
//export default CheckAnnotationRows;
12 changes: 6 additions & 6 deletions src/core/book-package-check.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import React from 'react';
import * as books from './books';
import { getRepoName, getFilelistFromZip, getFileCached, fetchRepositoryZipFile } from './getApi';
import checkUSFMText from './usfm-text-check';
import checkMarkdownText from './markdown-text-check';
import checkPlainText from './plain-text-check';
import checkYAMLText from './yaml-text-check';
import checkManifestText from './manifest-text-check';
import checkTN_TSVText from './tn-table-text-check';
import {checkUSFMText} from './usfm-text-check';
import {checkMarkdownText} from './markdown-text-check';
import {checkPlainText} from './plain-text-check';
import {checkYAMLText} from './yaml-text-check';
import {checkManifestText} from './manifest-text-check';
import {checkTN_TSVText} from './tn-table-text-check';


/*
Expand Down
4 changes: 2 additions & 2 deletions src/core/field-link-check.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ const LINK_VALIDATOR_VERSION_STRING = '0.3.2';
// const DEFAULT_EXTRACT_LENGTH = 10;


async function startLiveLinksCheck(linksList, existingNoticeList, callbackFunction) {
export async function startLiveLinksCheck(linksList, existingNoticeList, callbackFunction) {
// This (slow) function checks the targets of the given links
// to ensure that they actually exist
// NOTE: no caching yet
Expand Down Expand Up @@ -146,4 +146,4 @@ function checkFieldLinks(fieldName, fieldText, linkOptions, optionalFieldLocatio
}
// end of checkFieldLinks function

export default checkFieldLinks;
//export default checkFieldLinks;
2 changes: 1 addition & 1 deletion src/core/field-text-check.js
Original file line number Diff line number Diff line change
Expand Up @@ -202,4 +202,4 @@ export function checkTextField(fieldName, fieldText, allowedLinks, optionalField
}
// end of checkTextField function

export default checkTextField;
//export default checkTextField;
2 changes: 1 addition & 1 deletion src/core/file-text-check.js
Original file line number Diff line number Diff line change
Expand Up @@ -124,4 +124,4 @@ export function checkTextfileContents(languageCode, filename, fileText, optional
}
// end of checkTextfileContents function

export default checkTextfileContents;
//export default checkTextfileContents;
1 change: 1 addition & 0 deletions src/core/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ export * from './utilities';
export * from './getApi';
export * from './text-handling-functions';
export * from './field-text-check';
export * from './file-text-check';
export * from './markdown-text-check';
export * from './plain-text-check';
export * from './tn-table-row-check';
Expand Down
6 changes: 3 additions & 3 deletions src/core/manifest-text-check.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import checkYAMLText from './yaml-text-check';
import {checkYAMLText} from './yaml-text-check';
import * as books from './books';


Expand All @@ -7,7 +7,7 @@ const MANIFEST_VALIDATOR_VERSION_STRING = '0.2.1';
const DEFAULT_EXTRACT_LENGTH = 10;


function checkManifestText(textName, manifestText, givenLocation, optionalCheckingOptions) {
export function checkManifestText(textName, manifestText, givenLocation, optionalCheckingOptions) {
/* This function is optimised for checking the entire file, i.e., all lines.

See the specification at https://resource-container.readthedocs.io/en/latest/manifest.html.
Expand Down Expand Up @@ -124,4 +124,4 @@ function checkManifestText(textName, manifestText, givenLocation, optionalChecki
// end of checkManifestText function


export default checkManifestText;
//export default checkManifestText;
6 changes: 3 additions & 3 deletions src/core/markdown-text-check.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import checkTextField from './field-text-check';
import {checkTextField} from './field-text-check';


const MARKDOWN_VALIDATOR_VERSION_STRING = '0.3.1';

const DEFAULT_EXTRACT_LENGTH = 10;


function checkMarkdownText(textName, markdownText, givenLocation, optionalCheckingOptions) {
export function checkMarkdownText(textName, markdownText, givenLocation, optionalCheckingOptions) {
/* This function is optimised for checking the entire markdown file, i.e., all lines.

Note: This function does not check that any link targets in the markdown are valid links.
Expand Down Expand Up @@ -167,4 +167,4 @@ function checkMarkdownText(textName, markdownText, givenLocation, optionalChecki
// end of checkMarkdownText function


export default checkMarkdownText;
//export default checkMarkdownText;
6 changes: 3 additions & 3 deletions src/core/plain-text-check.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import checkTextField from './field-text-check';
import {checkTextField} from './field-text-check';


const PLAIN_TEXT_VALIDATOR_VERSION_STRING = '0.1.1';

const DEFAULT_EXTRACT_LENGTH = 10;


function checkPlainText(textName, plainText, givenLocation, optionalCheckingOptions) {
export function checkPlainText(textName, plainText, givenLocation, optionalCheckingOptions) {
/* This function is optimised for checking the entire text, i.e., all lines.

Returns a result object containing a successList and a noticeList
Expand Down Expand Up @@ -127,4 +127,4 @@ function checkPlainText(textName, plainText, givenLocation, optionalCheckingOpti
// end of checkPlainText function


export default checkPlainText;
//export default checkPlainText;
4 changes: 2 additions & 2 deletions src/core/quote-check.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import { getFileCached } from '../core/getApi';
const DEFAULT_EXTRACT_LENGTH = 10;


async function checkOriginalLanguageQuote(fieldName, fieldText, bookID, C, V, givenLocation, optionalCheckingOptions) {
export async function checkOriginalLanguageQuote(fieldName, fieldText, bookID, C, V, givenLocation, optionalCheckingOptions) {
// Checks that the Hebrew/Greek quote can be found in the original texts

// bookID is a three-character UPPERCASE USFM book identifier or 'OBS'.
Expand Down Expand Up @@ -301,4 +301,4 @@ async function checkOriginalLanguageQuote(fieldName, fieldText, bookID, C, V, gi
// end of checkOriginalLanguageQuote function


export default checkOriginalLanguageQuote;
//export default checkOriginalLanguageQuote;
4 changes: 2 additions & 2 deletions src/core/ta-reference-check.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { getFileCached } from '../core/getApi';
// const DEFAULT_EXTRACT_LENGTH = 10;


async function checkTAReference(fieldName, fieldText, givenLocation, optionalCheckingOptions) {
export async function checkTAReference(fieldName, fieldText, givenLocation, optionalCheckingOptions) {
// This is for the case of the full SupportReference field being the article link
// which is assumed to be in the translate part of the TA manual.

Expand Down Expand Up @@ -111,4 +111,4 @@ async function checkTAReference(fieldName, fieldText, givenLocation, optionalChe
// end of checkTAReference function


export default checkTAReference;
//export default checkTAReference;
4 changes: 2 additions & 2 deletions src/core/tn-links-check.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import { ourParseInt } from './utilities';
// const DEFAULT_EXTRACT_LENGTH = 10;


async function checkTNLinks(bookID, fieldName, fieldText, givenLocation, optionalCheckingOptions) {
export async function checkTNLinks(bookID, fieldName, fieldText, givenLocation, optionalCheckingOptions) {
/* This is for the case of the OccurrenceNote field containing markdown links

bookID is a three-character UPPERCASE USFM book identifier or 'OBS'.
Expand Down Expand Up @@ -214,4 +214,4 @@ async function checkTNLinks(bookID, fieldName, fieldText, givenLocation, optiona
// end of checkTNLinks function


export default checkTNLinks;
//export default checkTNLinks;
14 changes: 7 additions & 7 deletions src/core/tn-table-row-check.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import * as books from './books/books';
import checkTextField from './field-text-check';
import checkMarkdownText from './markdown-text-check';
import checkTAReference from './ta-reference-check';
import checkTNLinks from './tn-links-check';
import checkOriginalLanguageQuote from './quote-check';
import {checkTextField} from './field-text-check';
import {checkMarkdownText} from './markdown-text-check';
import {checkTAReference} from './ta-reference-check';
import {checkTNLinks} from './tn-links-check';
import {checkOriginalLanguageQuote} from './quote-check';


// const TN_TABLE_ROW_VALIDATOR_VERSION_STRING = '0.4.2';
Expand All @@ -14,7 +14,7 @@ const EXPECTED_TN_HEADING_LINE = 'Book\tChapter\tVerse\tID\tSupportReference\tOr
const DEFAULT_EXTRACT_LENGTH = 10;


async function checkTN_TSVDataRow(languageCode, line, bookID, C, V, givenRowLocation, optionalCheckingOptions) {
export async function checkTN_TSVDataRow(languageCode, line, bookID, C, V, givenRowLocation, optionalCheckingOptions) {
/**
* @description - Checks one TSV data row of translation notes (TN)
* @param {String} line - the TSV line to be checked
Expand Down Expand Up @@ -414,4 +414,4 @@ async function checkTN_TSVDataRow(languageCode, line, bookID, C, V, givenRowLoca
}
// end of checkTN_TSVDataRow function

export default checkTN_TSVDataRow;
//export default checkTN_TSVDataRow;
6 changes: 3 additions & 3 deletions src/core/tn-table-text-check.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import * as books from './books/books';
import checkTN_TSVDataRow from './tn-table-row-check';
import {checkTN_TSVDataRow} from './tn-table-row-check';


const TN_TABLE_TEXT_VALIDATOR_VERSION_STRING = '0.2.3';
Expand All @@ -10,7 +10,7 @@ const EXPECTED_TN_HEADING_LINE = 'Book\tChapter\tVerse\tID\tSupportReference\tOr
const DEFAULT_EXTRACT_LENGTH = 10;


async function checkTN_TSVText(languageCode, bookID, filename, tableText, givenLocation, optionalCheckingOptions) {
export async function checkTN_TSVText(languageCode, bookID, filename, tableText, givenLocation, optionalCheckingOptions) {
/* This function is optimised for checking the entire file, i.e., all rows.

It also has the advantage of being able to compare one row with the previous one.
Expand Down Expand Up @@ -203,4 +203,4 @@ async function checkTN_TSVText(languageCode, bookID, filename, tableText, givenL
// end of checkTN_TSVText function


export default checkTN_TSVText;
//export default checkTN_TSVText;
2 changes: 1 addition & 1 deletion src/core/usfm-js-check.js
Original file line number Diff line number Diff line change
Expand Up @@ -85,4 +85,4 @@ export function checkUSFMToJSON(bookID, filename, givenText, givenLocation, opti
// end of checkUSFMToJSON function


export default checkUSFMToJSON;
//export default checkUSFMToJSON;
8 changes: 4 additions & 4 deletions src/core/usfm-text-check.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import * as books from '../core/books/books';
import { isWhitespace, countOccurrences } from './text-handling-functions'
import checkTextField from './field-text-check';
import checkTextfileContents from './file-text-check';
import {checkTextField} from './field-text-check';
import {checkTextfileContents} from './file-text-check';
import { runUsfmJsCheck } from './usfm-js-check';
import { runBCSGrammarCheck } from './BCS-usfm-grammar-check';
import { ourParseInt } from './utilities';
Expand Down Expand Up @@ -76,7 +76,7 @@ const EXPECTED_BIBLE_BOOK_MARKERS = ['h', 'toc1', 'toc2', 'toc3'];
const EXPECTED_PERIPHERAL_BOOK_MARKERS = ['periph'];


function checkUSFMText(languageCode, bookID, filename, givenText, givenLocation, optionalCheckingOptions) {
export function checkUSFMText(languageCode, bookID, filename, givenText, givenLocation, optionalCheckingOptions) {
/* This function is optimised for checking the entire file, i.e., all lines.

bookID is a three-character UPPERCASE USFM book identifier.
Expand Down Expand Up @@ -743,4 +743,4 @@ function checkUSFMText(languageCode, bookID, filename, givenText, givenLocation,
// end of checkUSFMText function


export default checkUSFMText;
//export default checkUSFMText;
6 changes: 3 additions & 3 deletions src/core/yaml-text-check.js
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
// import { isWhitespace, countOccurrences } from './text-handling-functions'
import yaml from 'yaml';
import checkTextField from './field-text-check';
import {checkTextField} from './field-text-check';


const YAML_VALIDATOR_VERSION_STRING = '0.1.1';

const DEFAULT_EXTRACT_LENGTH = 10;


function checkYAMLText(textName, YAMLText, givenLocation, optionalCheckingOptions) {
export function checkYAMLText(textName, YAMLText, givenLocation, optionalCheckingOptions) {
/* This function is optimised for checking the entire file, i.e., all lines.

Returns a result object containing a successList and a noticeList,
Expand Down Expand Up @@ -166,4 +166,4 @@ function checkYAMLText(textName, YAMLText, givenLocation, optionalCheckingOption
// end of checkYAMLText function


export default checkYAMLText;
//export default checkYAMLText;