Skip to content
This repository has been archived by the owner on Oct 1, 2024. It is now read-only.

Commit

Permalink
refactor(i18nTagSchema): removed default export and added generateTra…
Browse files Browse the repository at this point in the history
…nslationSchema export

BREAKING CHANGE: The i18nTagSchema default export has been remove and renamed to

generateTranslationSchema
  • Loading branch information
skolmer committed Nov 1, 2016
1 parent 8ee5fef commit 38bce23
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions __tests__/i18n-tag-schema.test.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import path from 'path'
import fs from 'fs'
import i18nTagSchema, { exportTranslationKeys, validateTranslations } from '../lib'
import { generateTranslationSchema, exportTranslationKeys, validateTranslations } from '../lib'

const expected = {
'type': 'object',
Expand Down Expand Up @@ -95,7 +95,7 @@ describe('i18n-tag-schema', () => {
it('should match json string', (done) => {
const filter = '\\.jsx?$'
const srcPath = path.resolve(__dirname, './samples')
i18nTagSchema({
generateTranslationSchema({
srcPath,
filter,
logger: { toConsole: true },
Expand All @@ -111,7 +111,7 @@ describe('i18n-tag-schema', () => {
const filter = '\\.jsx?$'
const srcPath = path.resolve(__dirname, './samples')
const schemaPath = path.resolve(__dirname, './samples/schema.json')
i18nTagSchema({
generateTranslationSchema({
srcPath,
schemaPath,
filter,
Expand Down
4 changes: 2 additions & 2 deletions lib/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -654,7 +654,7 @@ export const exportTranslationKeys = ({rootPath, filePath = '.', filter = defaul


/**
* i18nTagSchema generates a JSON schema of all i18n tagged template literals in `srcPath`
* generateTranslationSchema generates a JSON schema of all i18n tagged template literals in `srcPath`
*
* @export
* @param {Object} options - The schema generator options.
Expand All @@ -665,7 +665,7 @@ export const exportTranslationKeys = ({rootPath, filePath = '.', filter = defaul
* @param {logger} [options.logger] - A custom logger.
* @param {progress} [options.progress] - A progress callback.
*/
export default function ({ srcPath, schemaPath, filter = defaultFileFilter, logger, callback, progress }) {
export const generateTranslationSchema = ({ srcPath, schemaPath, filter = defaultFileFilter, logger, callback, progress }) => {
if(!srcPath) {
const error = 'srcPath is not defined.'
logError(logger, error)
Expand Down

0 comments on commit 38bce23

Please sign in to comment.