Skip to content

Commit

Permalink
fix bundle generation
Browse files Browse the repository at this point in the history
  • Loading branch information
RgnDunes committed Jan 29, 2025
1 parent 31b9ccd commit 89df66e
Show file tree
Hide file tree
Showing 15 changed files with 36 additions and 11 deletions.
1 change: 1 addition & 0 deletions packages/i18nify-js/banking.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export * from './lib/esm/banking';
1 change: 1 addition & 0 deletions packages/i18nify-js/geo.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export * from './lib/esm/geo';
6 changes: 5 additions & 1 deletion packages/i18nify-js/jest.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,11 @@ const config = {
testEnvironment: 'jsdom',
testMatch: ['**/__tests__/**/*.test.[jt]s?(x)', '**/?(*.)+test.[jt]s?(x)'],
collectCoverageFrom: ['**/*.{ts,js}', '!coverage/**/*.{ts,tsx,js,jsx}'],
coveragePathIgnorePatterns: ['blackbox', '.spec.ts'],
coveragePathIgnorePatterns: [
'blackbox',
'.spec.ts',
'modules/shared/index.ts$',
],
coverageThreshold: {
'./src/': {
statements: 0,
Expand Down
9 changes: 8 additions & 1 deletion packages/i18nify-js/scripts/generate-root-imports.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,14 @@ const fs = require('fs');
const path = require('path');

// TODO: Currently, we will have to manually add every new module that we create. Automate this in future.
const EXPORT_MODULES = ['currency', 'phoneNumber', 'core', 'types'];
const EXPORT_MODULES = [
'currency',
'phoneNumber',
'core',
'types',
'geo',
'banking',
];
const BUILD_DIRECTORY = 'lib';

try {
Expand Down
2 changes: 1 addition & 1 deletion packages/i18nify-js/src/modules/banking/getListOfBanks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { I18nifyCountryCodeType } from '../geo/types';
import {
I18NIFY_DATA_SOURCE,
I18NIFY_DATA_SUPPORTED_COUNTRIES,
} from '../sourceConstants';
} from '../shared/sourceConstants';

/**
* Retrieves the list of all banks available for a specified country.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
import { getFlagOfCountry } from '../index';
import { LIST_OF_ALL_COUNTRIES } from '../data/listOfAllCountries';
import { FLAG_4X3_BASE_PATH, FLAG_BASE_PATH } from '../../sourceConstants';
import {
FLAG_4X3_BASE_PATH,
FLAG_BASE_PATH,
} from '../../shared/sourceConstants';
import { CountryCodeType } from '../../types';

describe('geo - getFlagOfCountry', () => {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
import { getFlagsForAllCountries } from '../index';
import { LIST_OF_ALL_COUNTRIES } from '../data/listOfAllCountries';
import { FLAG_4X3_BASE_PATH, FLAG_BASE_PATH } from '../../sourceConstants';
import {
FLAG_4X3_BASE_PATH,
FLAG_BASE_PATH,
} from '../../shared/sourceConstants';
import { CountryCodeType } from '../../types';

describe('geo - getFlagsForAllCountries', () => {
Expand Down
2 changes: 1 addition & 1 deletion packages/i18nify-js/src/modules/geo/getAllCountries.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { withErrorBoundary } from '../../common/errorBoundary';
import { CountryCodeType } from '../types';
import { I18NIFY_DATA_SOURCE } from '../sourceConstants';
import { I18NIFY_DATA_SOURCE } from '../shared/sourceConstants';
import { CountryMetaType } from './types';

/**
Expand Down
2 changes: 1 addition & 1 deletion packages/i18nify-js/src/modules/geo/getCities.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { withErrorBoundary } from '../../common/errorBoundary';
import {
I18NIFY_DATA_SOURCE,
I18NIFY_DATA_SUPPORTED_COUNTRIES,
} from '../sourceConstants';
} from '../shared/sourceConstants';
import { I18nifyCountryCodeType } from './types';

/**
Expand Down
2 changes: 1 addition & 1 deletion packages/i18nify-js/src/modules/geo/getFlagOfCountry.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { CountryCodeType, GetFlagReturnType } from '../types';
import { withErrorBoundary } from '../../common/errorBoundary';
import { FLAG_4X3_BASE_PATH, FLAG_BASE_PATH } from '../sourceConstants';
import { FLAG_4X3_BASE_PATH, FLAG_BASE_PATH } from '../shared/sourceConstants';
import { isCountryValid } from './utils';

/**
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { withErrorBoundary } from '../../common/errorBoundary';
import { LIST_OF_ALL_COUNTRIES } from './data/listOfAllCountries';
import { FLAG_4X3_BASE_PATH, FLAG_BASE_PATH } from '../sourceConstants';
import { FLAG_4X3_BASE_PATH, FLAG_BASE_PATH } from '../shared/sourceConstants';
import { GetFlagReturnType, CountryCodeType } from '../types';

/**
Expand Down
2 changes: 1 addition & 1 deletion packages/i18nify-js/src/modules/geo/getStates.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { withErrorBoundary } from '../../common/errorBoundary';
import {
I18NIFY_DATA_SOURCE,
I18NIFY_DATA_SUPPORTED_COUNTRIES,
} from '../sourceConstants';
} from '../shared/sourceConstants';
import { I18nifyCountryCodeType } from './types';

/**
Expand Down
2 changes: 1 addition & 1 deletion packages/i18nify-js/src/modules/geo/getZipcodes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { CountryCodeType } from '../types';
import {
I18NIFY_DATA_SOURCE,
I18NIFY_DATA_SUPPORTED_COUNTRIES,
} from '../sourceConstants';
} from '../shared/sourceConstants';
import { CountryDetailType } from './types';

/**
Expand Down
6 changes: 6 additions & 0 deletions packages/i18nify-js/src/modules/shared/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
export {
FLAG_4X3_BASE_PATH,
FLAG_BASE_PATH,
I18NIFY_DATA_SOURCE,
I18NIFY_DATA_SUPPORTED_COUNTRIES,
} from './sourceConstants';

0 comments on commit 89df66e

Please sign in to comment.