Skip to content

Commit

Permalink
Signup: Convert from CommonJS to ES6 imports
Browse files Browse the repository at this point in the history
  • Loading branch information
jsnmoon authored and drewblaisdell committed Mar 17, 2017
1 parent 02dac62 commit 907edf7
Show file tree
Hide file tree
Showing 10 changed files with 79 additions and 80 deletions.
22 changes: 11 additions & 11 deletions client/signup/config/step-components.js
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
/**
* Internal dependencies
*/
var config = require( 'config' ),
DesignTypeComponent = require( 'signup/steps/design-type' ),
DesignTypeWithStoreComponent = require( 'signup/steps/design-type-with-store' ),
DomainsStepComponent = require( 'signup/steps/domains' ),
GetDotBlogPlansStepComponent = require( 'signup/steps/get-dot-blog-plans' ),
PlansStepComponent = require( 'signup/steps/plans' ),
SiteComponent = require( 'signup/steps/site' ),
SiteOrDomainComponent = require( 'signup/steps/site-or-domain' ),
SiteTitleComponent = require( 'signup/steps/site-title' ),
SurveyStepComponent = require( 'signup/steps/survey' ),
ThemeSelectionComponent = require( 'signup/steps/theme-selection' );
import config from 'config';
import DesignTypeComponent from 'signup/steps/design-type';
import DesignTypeWithStoreComponent from 'signup/steps/design-type-with-store';
import DomainsStepComponent from 'signup/steps/domains';
import GetDotBlogPlansStepComponent from 'signup/steps/get-dot-blog-plans';
import PlansStepComponent from 'signup/steps/plans';
import SiteComponent from 'signup/steps/site';
import SiteOrDomainComponent from 'signup/steps/site-or-domain';
import SiteTitleComponent from 'signup/steps/site-title';
import SurveyStepComponent from 'signup/steps/survey';
import ThemeSelectionComponent from 'signup/steps/theme-selection';
import UserSignupComponent from 'signup/steps/user';
import PlansStepWithoutFreePlan from 'signup/steps/plans-without-free';

Expand Down
4 changes: 2 additions & 2 deletions client/signup/flow-progress-indicator/index.jsx
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
/**
* External dependencies
*/
var React = require( 'react' );
import React from 'react';

/**
* Internal dependencies
*/
var flows = require( 'signup/config/flows' );
import flows from 'signup/config/flows';

module.exports = React.createClass( {
displayName: 'FlowProgressIndicator',
Expand Down
12 changes: 6 additions & 6 deletions client/signup/locale-suggestions/index.jsx
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
/**
* External dependencies
*/
var i18n = require( 'i18n-calypso'),
React = require( 'react' ),
assign = require( 'lodash/assign' );
import i18n from 'i18n-calypso';
import React from 'react';
import assign from 'lodash/assign';

/**
* Internal dependencies
*/
var i18nUtils = require( 'lib/i18n-utils' ),
switchLocale = require( 'lib/i18n-utils/switch-locale' ),
LocaleSuggestionStore = require( 'lib/locale-suggestions' );
import i18nUtils from 'lib/i18n-utils';
import switchLocale from 'lib/i18n-utils/switch-locale';
import LocaleSuggestionStore from 'lib/locale-suggestions';

import Notice from 'components/notice';

Expand Down
33 changes: 16 additions & 17 deletions client/signup/steps/domains/index.jsx
Original file line number Diff line number Diff line change
@@ -1,27 +1,26 @@
/**
* External dependencies
*/
var React = require( 'react' ),
{ PropTypes } = React,
{ connect } = require( 'react-redux' ),
defer = require( 'lodash/defer' ),
page = require( 'page' ),
i18n = require( 'i18n-calypso' );
import React, { PropTypes } from 'react';
import { connect } from 'react-redux';
import defer from 'lodash/defer';
import page from 'page';
import i18n from 'i18n-calypso';

/**
* Internal dependencies
*/
var StepWrapper = require( 'signup/step-wrapper' ),
productsList = require( 'lib/products-list' )(),
cartItems = require( 'lib/cart-values' ).cartItems,
SignupActions = require( 'lib/signup/actions' ),
MapDomainStep = require( 'components/domains/map-domain-step' ),
RegisterDomainStep = require( 'components/domains/register-domain-step' ),
{ DOMAINS_WITH_PLANS_ONLY } = require( 'state/current-user/constants' ),
{ getSurveyVertical } = require( 'state/signup/steps/survey/selectors.js' ),
analyticsMixin = require( 'lib/mixins/analytics' ),
signupUtils = require( 'signup/utils' ),
getUsernameSuggestion = require( 'lib/signup/step-actions' ).getUsernameSuggestion;
import StepWrapper from 'signup/step-wrapper';
const productsList = require( 'lib/products-list' )();
import { cartItems } from 'lib/cart-values';
import SignupActions from 'lib/signup/actions';
import MapDomainStep from 'components/domains/map-domain-step';
import RegisterDomainStep from 'components/domains/register-domain-step';
import { DOMAINS_WITH_PLANS_ONLY } from 'state/current-user/constants';
import { getSurveyVertical } from 'state/signup/steps/survey/selectors.js';
import analyticsMixin from 'lib/mixins/analytics';
import signupUtils from 'signup/utils';
import { getUsernameSuggestion } from 'lib/signup/step-actions';

import { getCurrentUser, currentUserHasFlag } from 'state/current-user/selectors';
import Notice from 'components/notice';
Expand Down
34 changes: 17 additions & 17 deletions client/signup/steps/site/index.jsx
Original file line number Diff line number Diff line change
@@ -1,26 +1,26 @@
/**
* External dependencies
*/
var React = require( 'react' ),
isEmpty = require( 'lodash/isEmpty' ),
includes = require( 'lodash/includes' ),
map = require( 'lodash/map' ),
debug = require( 'debug' )( 'calypso:steps:site' ); // eslint-disable-line no-unused-vars
import React from 'react';
import isEmpty from 'lodash/isEmpty';
import includes from 'lodash/includes';
import map from 'lodash/map';
const debug = require( 'debug' )( 'calypso:steps:site' ); // eslint-disable-line no-unused-vars
/**
* Internal dependencies
*/
var wpcom = require( 'lib/wp' ),
config = require( 'config' ),
analytics = require( 'lib/analytics' ),
formState = require( 'lib/form-state' ),
SignupActions = require( 'lib/signup/actions' ),
ValidationFieldset = require( 'signup/validation-fieldset' ),
FormLabel = require( 'components/forms/form-label' ),
FormButton = require( 'components/forms/form-button' ),
FormTextInput = require( 'components/forms/form-text-input' ),
StepWrapper = require( 'signup/step-wrapper' ),
LoggedOutForm = require( 'components/logged-out-form' ),
LoggedOutFormFooter = require( 'components/logged-out-form/footer' );
import wpcom from 'lib/wp';
import config from 'config';
import analytics from 'lib/analytics';
import formState from 'lib/form-state';
import SignupActions from 'lib/signup/actions';
import ValidationFieldset from 'signup/validation-fieldset';
import FormLabel from 'components/forms/form-label';
import FormButton from 'components/forms/form-button';
import FormTextInput from 'components/forms/form-text-input';
import StepWrapper from 'signup/step-wrapper';
import LoggedOutForm from 'components/logged-out-form';
import LoggedOutFormFooter from 'components/logged-out-form/footer';

/**
* Constants
Expand Down
8 changes: 4 additions & 4 deletions client/signup/steps/test-step/index.jsx
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
/**
* External dependencies
*/
var React = require( 'react' ),
debug = require( 'debug' )( 'calypso:steps:test' );
import React from 'react';
const debug = require( 'debug' )( 'calypso:steps:test' );

/**
* Internal dependencies
*/
var StepWrapper = require( 'signup/step-wrapper' ),
SubmitStepButton = require( 'signup/submit-step-button' );
import StepWrapper from 'signup/step-wrapper';
import SubmitStepButton from 'signup/submit-step-button';

module.exports = React.createClass( {
displayName: 'TestStep',
Expand Down
4 changes: 2 additions & 2 deletions client/signup/submit-step-button/index.jsx
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
/**
* External dependencies
*/
var React = require( 'react' );
import React from 'react';

/**
* Internal dependencies
*/
var SignupActions = require( 'lib/signup/actions' );
import SignupActions from 'lib/signup/actions';

module.exports = React.createClass( {
displayName: 'SubmitStepButton',
Expand Down
22 changes: 11 additions & 11 deletions client/signup/utils.js
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
/**
* Exernal dependencies
*/
var isEmpty = require( 'lodash/isEmpty' ),
find = require( 'lodash/find' ),
indexOf = require( 'lodash/indexOf' ),
pick = require( 'lodash/pick' ),
merge = require( 'lodash/merge' );
import isEmpty from 'lodash/isEmpty';
import find from 'lodash/find';
import indexOf from 'lodash/indexOf';
import pick from 'lodash/pick';
import merge from 'lodash/merge';

/**
* Internal dependencies
*/
var i18nUtils = require( 'lib/i18n-utils' ),
steps = require( 'signup/config/steps' ),
flows = require( 'signup/config/flows' ),
defaultFlowName = require( 'signup/config/flows' ).defaultFlowName,
formState = require( 'lib/form-state' ),
user = require( 'lib/user' )();
import i18nUtils from 'lib/i18n-utils';
import steps from 'signup/config/steps';
import flows from 'signup/config/flows';
import { defaultFlowName } from 'signup/config/flows';
import formState from 'lib/form-state';
const user = require( 'lib/user' )();

function getFlowName( parameters ) {
const flow = ( parameters.flowName && isFlowName( parameters.flowName ) ) ? parameters.flowName : defaultFlowName;
Expand Down
14 changes: 7 additions & 7 deletions client/signup/validation-fieldset/index.jsx
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
/**
* External dependencies
*/
var React = require( 'react' ),
classNames = require( 'classnames' ),
head = require( 'lodash/head' ),
values = require( 'lodash/values' ),
debug = require( 'debug' )( 'calypso:validate-fieldset' ); // eslint-disable-line no-unused-vars
import React from 'react';
import classNames from 'classnames';
import head from 'lodash/head';
import values from 'lodash/values';
const debug = require( 'debug' )( 'calypso:validate-fieldset' ); // eslint-disable-line no-unused-vars

/**
* Internal dependencies
*/
var FormFieldset = require( 'components/forms/form-fieldset' ),
FormInputValidation = require( 'components/forms/form-input-validation' );
import FormFieldset from 'components/forms/form-fieldset';
import FormInputValidation from 'components/forms/form-input-validation';

module.exports = React.createClass( {
displayName: 'ValidationFieldset',
Expand Down
6 changes: 3 additions & 3 deletions client/signup/wpcom-login-form/index.jsx
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
/**
* External dependencies
*/
var React = require( 'react' ),
debug = require( 'debug' )( 'calypso:signup:wpcom-login' );
import React from 'react';
const debug = require( 'debug' )( 'calypso:signup:wpcom-login' );

/**
* Internal dependencies
*/
var config = require( 'config' );
import config from 'config';

module.exports = React.createClass( {
displayName: 'WpcomLoginForm',
Expand Down

0 comments on commit 907edf7

Please sign in to comment.