diff --git a/__tests__/client/client.jsx b/__tests__/client/client.jsx index f76a304068..84e6e19b26 100644 --- a/__tests__/client/client.jsx +++ b/__tests__/client/client.jsx @@ -106,7 +106,7 @@ const mockTcAccounts = { decodeToken: () => ({ exp: Date.now() }), getFreshToken: () => Promise.resolve(tokenV3), }; -jest.setMock('tc-auth-lib', mockTcAccounts); +jest.setMock('@topcoder-platform/tc-auth-lib', mockTcAccounts); /* Mock auth actions */ /* diff --git a/__tests__/shared/reducers/auth.js b/__tests__/shared/reducers/auth.js index d6c9f923bc..85ae05645f 100644 --- a/__tests__/shared/reducers/auth.js +++ b/__tests__/shared/reducers/auth.js @@ -24,7 +24,7 @@ const mockActions = { _.merge(actions, mockActions); -jest.setMock('tc-auth-lib', { +jest.setMock('@topcoder-platform/tc-auth-lib', { decodeToken: () => 'User object', isTokenExpired: () => false, }); diff --git a/__tests__/shared/reducers/challenge.js b/__tests__/shared/reducers/challenge.js index a65d45fea6..2d4e112a9d 100644 --- a/__tests__/shared/reducers/challenge.js +++ b/__tests__/shared/reducers/challenge.js @@ -11,7 +11,7 @@ import { mock, actions } from 'topcoder-react-lib'; const { mockAction } = mock; -jest.setMock('tc-auth-lib', { +jest.setMock('@topcoder-platform/tc-auth-lib', { decodeToken: () => 'User object', isTokenExpired: () => false, }); diff --git a/bin/www b/bin/www index 0ed62f7ba6..ef2d8722eb 100644 --- a/bin/www +++ b/bin/www @@ -5,7 +5,7 @@ /* Enables Babel for the server-side code (with exception of this very file). */ require('babel-register')({ ignore: [ - /node_modules\/(?!appirio-tech.*|topcoder|tc-)/, + /node_modules\/(?!appirio-tech.*|topcoder|tc-|@topcoder)/, /node_modules\/topcoder-react-utils/, ], }); diff --git a/config/jest/default.js b/config/jest/default.js index bcf9b8d5af..bc35369eba 100644 --- a/config/jest/default.js +++ b/config/jest/default.js @@ -1,7 +1,7 @@ const config = require('topcoder-react-utils/config/jest/default'); const nodeConfig = require('config'); -config.transformIgnorePatterns[0] = '/node_modules/(?!appirio-tech|topcoder|tc-)'; +config.transformIgnorePatterns[0] = '/node_modules/(?!appirio-tech|topcoder|tc-|@topcoder)'; // Include the directories whose tests has been written to minimize coverage time config.collectCoverageFrom = ['src/client/*.{js,jsx}', 'src/server/*.{js,jsx}', 'src/shared/*.{js,jsx}']; diff --git a/config/webpack/development.js b/config/webpack/development.js index a7b910a4d3..bc853989aa 100644 --- a/config/webpack/development.js +++ b/config/webpack/development.js @@ -17,7 +17,7 @@ const standardDevelopmentConfig = configFactory({ const jsxRule = standardDevelopmentConfig.module.rules.find(rule => rule.loader === 'babel-loader'); jsxRule.exclude = [ - /node_modules[\\/](?!appirio-tech.*|topcoder|tc-)/, + /node_modules[\\/](?!appirio-tech.*|topcoder|tc-|@topcoder)/, /src[\\/]assets[\\/]fonts/, /src[\\/]assets[\\/]images[\\/]dashboard/, ]; diff --git a/config/webpack/production.js b/config/webpack/production.js index 4023147b4d..ab95dbac37 100644 --- a/config/webpack/production.js +++ b/config/webpack/production.js @@ -24,7 +24,7 @@ const standardDevelopmentConfig = configFactory({ const jsxRule = standardDevelopmentConfig.module.rules.find(rule => rule.loader === 'babel-loader'); jsxRule.exclude = [ - /node_modules[\\/](?!appirio-tech.*|topcoder|tc-)/, + /node_modules[\\/](?!appirio-tech.*|topcoder|tc-|@topcoder)/, /src[\\/]assets[\\/]fonts/, /src[\\/]assets[\\/]images[\\/]dashboard/, ]; diff --git a/package.json b/package.json index dda4a674af..a0c732f77b 100644 --- a/package.json +++ b/package.json @@ -37,6 +37,7 @@ }, "dependencies": { "@hapi/joi": "^16.1.4", + "@topcoder-platform/tc-auth-lib": "topcoder-platform/tc-auth-lib#1.0.1", "aos": "^2.3.4", "atob": "^2.1.1", "babel-register": "^6.26.0", @@ -134,7 +135,6 @@ "showdown": "^1.8.6", "slick-carousel": "^1.8.1", "supertest": "^3.1.0", - "tc-auth-lib": "git+https://github.com/topcoder-platform/tc-auth-lib.git#dev", "tc-core-library-js": "github:appirio-tech/tc-core-library-js#v2.6.3", "tc-ui": "^1.0.12", "topcoder-react-lib": "1.0.5", diff --git a/src/client/index.jsx b/src/client/index.jsx index 39af362f28..b44745e76e 100644 --- a/src/client/index.jsx +++ b/src/client/index.jsx @@ -11,7 +11,7 @@ import { configureConnector, decodeToken, getFreshToken, -} from 'tc-auth-lib'; +} from '@topcoder-platform/tc-auth-lib'; import { actions, logger, errors } from 'topcoder-react-lib'; import { client, redux } from 'topcoder-react-utils'; diff --git a/src/shared/actions/challenge-listing/index.js b/src/shared/actions/challenge-listing/index.js index c03710a480..2e0ac3e5cd 100644 --- a/src/shared/actions/challenge-listing/index.js +++ b/src/shared/actions/challenge-listing/index.js @@ -4,7 +4,7 @@ import _ from 'lodash'; import { createActions } from 'redux-actions'; -import { decodeToken } from 'tc-auth-lib'; +import { decodeToken } from '@topcoder-platform/tc-auth-lib'; import 'isomorphic-fetch'; import { processSRM } from 'utils/tc'; import { errors, services } from 'topcoder-react-lib'; diff --git a/src/shared/components/challenge-detail/MySubmissions/index.jsx b/src/shared/components/challenge-detail/MySubmissions/index.jsx index a450dd32cf..824b29d0d6 100644 --- a/src/shared/components/challenge-detail/MySubmissions/index.jsx +++ b/src/shared/components/challenge-detail/MySubmissions/index.jsx @@ -7,7 +7,7 @@ import PT from 'prop-types'; import _ from 'lodash'; import { goToLogin } from 'utils/tc'; import LoadingIndicator from 'components/LoadingIndicator'; -import { isTokenExpired } from 'tc-auth-lib'; +import { isTokenExpired } from '@topcoder-platform/tc-auth-lib'; import SubmissionsList from './SubmissionsList'; import SubmissionsDetail from './SubmissionsDetail'; diff --git a/src/shared/components/challenge-detail/Submissions/index.jsx b/src/shared/components/challenge-detail/Submissions/index.jsx index f3ead12c3f..380e3cf9ac 100644 --- a/src/shared/components/challenge-detail/Submissions/index.jsx +++ b/src/shared/components/challenge-detail/Submissions/index.jsx @@ -11,7 +11,7 @@ import _ from 'lodash'; import { connect } from 'react-redux'; import { config } from 'topcoder-react-utils'; import { submission as submissionUtils } from 'topcoder-react-lib'; -import { isTokenExpired } from 'tc-auth-lib'; +import { isTokenExpired } from '@topcoder-platform/tc-auth-lib'; import cn from 'classnames'; import { PrimaryButton } from 'topcoder-react-ui-kit'; diff --git a/src/shared/containers/Dashboard/index.jsx b/src/shared/containers/Dashboard/index.jsx index 6e4cd40ad3..915e98ac74 100644 --- a/src/shared/containers/Dashboard/index.jsx +++ b/src/shared/containers/Dashboard/index.jsx @@ -25,7 +25,7 @@ import { updateChallengeType } from 'utils/challenge'; import challengeListingActions from 'actions/challenge-listing'; import communityActions from 'actions/tc-communities'; -import { isTokenExpired, decodeToken } from 'tc-auth-lib'; +import { isTokenExpired, decodeToken } from '@topcoder-platform/tc-auth-lib'; import { config, isomorphy } from 'topcoder-react-utils'; import './styles.scss'; diff --git a/src/shared/containers/EmailVerification/index.jsx b/src/shared/containers/EmailVerification/index.jsx index eee56a96e5..e425db7c5a 100644 --- a/src/shared/containers/EmailVerification/index.jsx +++ b/src/shared/containers/EmailVerification/index.jsx @@ -8,7 +8,7 @@ import PT from 'prop-types'; import {connect} from "react-redux"; import { actions } from "topcoder-react-lib"; import { Redirect } from 'react-router'; -import {isTokenExpired} from "tc-auth-lib"; +import {isTokenExpired} from '@topcoder-platform/tc-auth-lib'; import * as queryString from 'query-string'; import LoadingIndicator from 'components/LoadingIndicator'; import Error404 from 'components/Error404'; diff --git a/src/shared/containers/Settings.jsx b/src/shared/containers/Settings.jsx index 1d43a99cb0..dcbaf86ad0 100644 --- a/src/shared/containers/Settings.jsx +++ b/src/shared/containers/Settings.jsx @@ -6,7 +6,7 @@ import React from 'react'; import PT from 'prop-types'; import { connect } from 'react-redux'; -import { isTokenExpired } from 'tc-auth-lib'; +import { isTokenExpired } from '@topcoder-platform/tc-auth-lib'; import { goToLogin } from 'utils/tc'; import { actions } from 'topcoder-react-lib'; diff --git a/src/shared/reducers/tc-communities/index.js b/src/shared/reducers/tc-communities/index.js index c7db77ae7f..5ab21acf3d 100644 --- a/src/shared/reducers/tc-communities/index.js +++ b/src/shared/reducers/tc-communities/index.js @@ -8,7 +8,7 @@ import _ from 'lodash'; import actions from 'actions/tc-communities'; import { logger, services, errors } from 'topcoder-react-lib'; import { handleActions } from 'redux-actions'; -import { decodeToken } from 'tc-auth-lib'; +import { decodeToken } from '@topcoder-platform/tc-auth-lib'; import { getAuthTokens } from 'utils/tc'; import { STATE as JOIN_COMMUNITY } from 'components/tc-communities/JoinCommunity'; import { getCommunityId } from 'server/services/communities'; diff --git a/src/shared/utils/tc.js b/src/shared/utils/tc.js index 8aff2c8620..305b783cad 100644 --- a/src/shared/utils/tc.js +++ b/src/shared/utils/tc.js @@ -5,7 +5,7 @@ import _ from 'lodash'; import moment from 'moment-timezone'; -import { isTokenExpired } from 'tc-auth-lib'; +import { isTokenExpired } from '@topcoder-platform/tc-auth-lib'; import { config, isomorphy } from 'topcoder-react-utils'; import { tc } from 'topcoder-react-lib';