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

Deploy #328

Merged
merged 3 commits into from
Jan 3, 2020
Merged

Deploy #328

merged 3 commits into from
Jan 3, 2020

Conversation

anandaroop
Copy link
Member

@anandaroop anandaroop commented Jan 3, 2020

Final bit of upkeep work (package warnings below are false positives due to re-organizing package.json)

@anandaroop anandaroop self-assigned this Jan 3, 2020
@artsy-peril artsy-peril bot merged commit bc400e9 into release Jan 3, 2020
@artsy-peril
Copy link
Contributor

artsy-peril bot commented Jan 3, 2020

New dependencies added: @babel/cli, @babel/core, @babel/plugin-proposal-class-properties, @babel/plugin-proposal-object-rest-spread, @babel/plugin-syntax-dynamic-import, @babel/plugin-transform-runtime, @babel/polyfill, @babel/preset-env, @babel/preset-react, @rails/webpacker, babel-loader, babel-plugin-module-resolver, babel-plugin-styled-components, css-loader, enzyme-adapter-react-16, enzyme, file-loader, jest-styled-components, jest, json-loader, react-addons-test-utils, react-test-renderer, stats-webpack-plugin, style-loader and webpack-cli.

@babel/preset-react

Author: Sebastian McKenzie

Description: Babel preset for all React plugins.

Homepage: https://babeljs.io/

Createdabout 2 years ago
Last Updatedabout 1 month ago
LicenseMIT
Maintainers6
Releases37
Direct Dependencies@babel/helper-plugin-utils, @babel/plugin-transform-react-display-name, @babel/plugin-transform-react-jsx, @babel/plugin-transform-react-jsx-self and @babel/plugin-transform-react-jsx-source
README

@babel/preset-react

Babel preset for all React plugins.

See our website @babel/preset-react for more information or the issues associated with this package.

Install

Using npm:

npm install --save-dev @babel/preset-react

or using yarn:

yarn add @babel/preset-react --dev

@rails/webpacker

Author: David Heinemeier Hansson

Description: Use webpack to manage app-like JavaScript modules in Rails

Homepage: https://github.com/rails/webpacker

Createdover 2 years ago
Last Updated25 days ago
LicenseMIT
Maintainers11
Releases43
Direct Dependencies@babel/core, @babel/plugin-proposal-class-properties, @babel/plugin-proposal-object-rest-spread, @babel/plugin-syntax-dynamic-import, @babel/plugin-transform-destructuring, @babel/plugin-transform-regenerator, @babel/plugin-transform-runtime, @babel/preset-env, @babel/runtime, babel-loader, babel-plugin-dynamic-import-node, babel-plugin-macros, case-sensitive-paths-webpack-plugin, compression-webpack-plugin, core-js, css-loader, file-loader, flatted, glob, js-yaml, mini-css-extract-plugin, node-sass, optimize-css-assets-webpack-plugin, path-complete-extname, pnp-webpack-plugin, postcss-flexbugs-fixes, postcss-import, postcss-loader, postcss-preset-env, postcss-safe-parser, regenerator-runtime, sass-loader, style-loader, terser-webpack-plugin, webpack, webpack-assets-manifest, webpack-cli and webpack-sources
This README is too long to show.

babel-loader

Author: Luis Couto

Description: babel module loader for webpack

Homepage: https://github.com/babel/babel-loader

Createdalmost 5 years ago
Last Updated8 months ago
LicenseMIT
Maintainers3
Releases63
Direct Dependenciesfind-cache-dir, loader-utils, mkdirp and pify
Keywordswebpack, loader, babel, es6, transpiler and module
This README is too long to show.

@babel/preset-env

Author: Henry Zhu

Description: A Babel preset for each environment.

Homepage: https://babeljs.io/

Createdabout 2 years ago
Last Updated16 days ago
LicenseMIT
Maintainers6
Releases62
Direct Dependencies@babel/helper-module-imports, @babel/helper-plugin-utils, @babel/plugin-proposal-async-generator-functions, @babel/plugin-proposal-dynamic-import, @babel/plugin-proposal-json-strings, @babel/plugin-proposal-object-rest-spread, @babel/plugin-proposal-optional-catch-binding, @babel/plugin-proposal-unicode-property-regex, @babel/plugin-syntax-async-generators, @babel/plugin-syntax-dynamic-import, @babel/plugin-syntax-json-strings, @babel/plugin-syntax-object-rest-spread, @babel/plugin-syntax-optional-catch-binding, @babel/plugin-syntax-top-level-await, @babel/plugin-transform-arrow-functions, @babel/plugin-transform-async-to-generator, @babel/plugin-transform-block-scoped-functions, @babel/plugin-transform-block-scoping, @babel/plugin-transform-classes, @babel/plugin-transform-computed-properties, @babel/plugin-transform-destructuring, @babel/plugin-transform-dotall-regex, @babel/plugin-transform-duplicate-keys, @babel/plugin-transform-exponentiation-operator, @babel/plugin-transform-for-of, @babel/plugin-transform-function-name, @babel/plugin-transform-literals, @babel/plugin-transform-member-expression-literals, @babel/plugin-transform-modules-amd, @babel/plugin-transform-modules-commonjs, @babel/plugin-transform-modules-systemjs, @babel/plugin-transform-modules-umd, @babel/plugin-transform-named-capturing-groups-regex, @babel/plugin-transform-new-target, @babel/plugin-transform-object-super, @babel/plugin-transform-parameters, @babel/plugin-transform-property-literals, @babel/plugin-transform-regenerator, @babel/plugin-transform-reserved-words, @babel/plugin-transform-shorthand-properties, @babel/plugin-transform-spread, @babel/plugin-transform-sticky-regex, @babel/plugin-transform-template-literals, @babel/plugin-transform-typeof-symbol, @babel/plugin-transform-unicode-regex, @babel/types, browserslist, core-js-compat, invariant, js-levenshtein and semver
README

@babel/preset-env

A Babel preset for each environment.

See our website @babel/preset-env for more information or the issues associated with this package.

Install

Using npm:

npm install --save-dev @babel/preset-env

or using yarn:

yarn add @babel/preset-env --dev

babel-plugin-styled-components

Author: Unknown

Description: Improve the debugging experience and add server-side rendering support to styled-components

Homepage: http://npmjs.com/package/babel-plugin-styled-components

Createdabout 3 years ago
Last Updated6 months ago
LicenseMIT
Maintainers3
Releases66
Direct Dependencies@babel/helper-annotate-as-pure, @babel/helper-module-imports, babel-plugin-syntax-jsx and lodash
Keywordsstyled-components, css-in-js, babel-plugin, server-side rendering, ssr and displayName
README

babel-plugin-styled-components

This plugin is a highly recommended supplement to the base styled-components library, offering some useful features:

  • consistently hashed component classNames between environments (a must for server-side rendering)
  • better debugging through automatic annotation of your styled components based on their context in the file system, etc.
  • various types of minification for styles and the tagged template literals styled-components uses

Quick start

Install the plugin first:

npm install --save-dev babel-plugin-styled-components

Then add it to your babel configuration:

{
  "plugins": ["babel-plugin-styled-components"]
}

Documentation

The documentation for this plugin lives on the styled-components website!

License

Licensed under the MIT License, Copyright © 2016-present Vladimir Danchenkov and Maximilian Stoiber.

See LICENSE.md for more information.

css-loader

Author: Tobias Koppers @sokra

Description: css loader module for webpack

Homepage: https://github.com/webpack-contrib/css-loader

Createdover 7 years ago
Last Updated17 days ago
LicenseMIT
Maintainers7
Releases99
Direct Dependenciescamelcase, cssesc, icss-utils, loader-utils, normalize-path, postcss, postcss-modules-extract-imports, postcss-modules-local-by-default, postcss-modules-scope, postcss-modules-values, postcss-value-parser and schema-utils
Keywordswebpack, css, loader, url and import
This README is too long to show.

enzyme-adapter-react-16

Author: Leland Richardson

Description: JavaScript Testing utilities for React

Homepage: https://airbnb.io/enzyme/

Createdover 2 years ago
Last Updated15 days ago
LicenseMIT
Maintainers7
Releases37
Direct Dependenciesenzyme-adapter-utils, enzyme-shallow-equal, has, object.assign, object.values, prop-types, react-is, react-test-renderer and semver
Keywordsjavascript, shallow rendering, shallowRender, test, reactjs, react, flux, testing, test utils, assertion helpers, tdd and mocha
README

Enzyme

Join the chat at https://gitter.im/airbnb/enzyme

npm Version License Build Status Coverage Status

Enzyme is a JavaScript Testing utility for React that makes it easier to test your React Components' output.
You can also manipulate, traverse, and in some ways simulate runtime given the output.

Enzyme's API is meant to be intuitive and flexible by mimicking jQuery's API for DOM manipulation
and traversal.

Upgrading from Enzyme 2.x or React < 16

Are you here to check whether or not Enzyme is compatible with React 16? Are you currently using
Enzyme 2.x? Great! Check out our migration guide for help
moving on to Enzyme v3 where React 16 is supported.

Installation

To get started with enzyme, you can simply install it via npm. You will need to install enzyme
along with an Adapter corresponding to the version of react (or other UI Component library) you
are using. For instance, if you are using enzyme with React 16, you can run:

npm i --save-dev enzyme enzyme-adapter-react-16

Each adapter may have additional peer dependencies which you will need to install as well. For instance,
enzyme-adapter-react-16 has peer dependencies on react and react-dom.

At the moment, Enzyme has adapters that provide compatibility with React 16.x, React 15.x,
React 0.14.x and React 0.13.x.

The following adapters are officially provided by enzyme, and have the following compatibility with
React:

Enzyme Adapter Package React semver compatibility
enzyme-adapter-react-16 ^16.4.0-0
enzyme-adapter-react-16.3 ~16.3.0-0
enzyme-adapter-react-16.2 ~16.2
enzyme-adapter-react-16.1 ~16.0.0-0 || ~16.1
enzyme-adapter-react-15 ^15.5.0
enzyme-adapter-react-15.4 15.0.0-0 - 15.4.x
enzyme-adapter-react-14 ^0.14.0
enzyme-adapter-react-13 ^0.13.0

Finally, you need to configure enzyme to use the adapter you want it to use. To do this, you can use
the top level configure(...) API.

import Enzyme from 'enzyme';
import Adapter from 'enzyme-adapter-react-16';

Enzyme.configure({ adapter: new Adapter() });

3rd Party Adapters

It is possible for the community to create additional (non-official) adapters that will make enzyme
work with other libraries. If you have made one and it's not included in the list below, feel free
to make a PR to this README and add a link to it! The known 3rd party adapters are:

Adapter Package For Library Status
enzyme-adapter-preact-pure preact (stable)
enzyme-adapter-inferno inferno (work in progress)

Running Enzyme Tests

Enzyme is unopinionated regarding which test runner or assertion library you use, and should be
compatible with all major test runners and assertion libraries out there. The documentation and
examples for enzyme use mocha and chai, but you
should be able to extrapolate to your framework of choice.

If you are interested in using enzyme with custom assertions and convenience functions for
testing your React components, you can consider using:

Using Enzyme with Mocha

Using Enzyme with Karma

Using Enzyme with Browserify

Using Enzyme with SystemJS

Using Enzyme with Webpack

Using Enzyme with JSDOM

Using Enzyme with React Native

Using Enzyme with Jest

Using Enzyme with Lab

Using Enzyme with Tape and AVA

Basic Usage

Shallow Rendering

import React from 'react';
import { expect } from 'chai';
import { shallow } from 'enzyme';
import sinon from 'sinon';

import MyComponent from './MyComponent';
import Foo from './Foo';

describe('<MyComponent />', () => {
  it('renders three <Foo /> components', () => {
    const wrapper = shallow(<MyComponent />);
    expect(wrapper.find(Foo)).to.have.lengthOf(3);
  });

  it('renders an `.icon-star`', () => {
    const wrapper = shallow(<MyComponent />);
    expect(wrapper.find('.icon-star')).to.have.lengthOf(1);
  });

  it('renders children when passed in', () => {
    const wrapper = shallow((
      <MyComponent>
        <div className="unique" />
      </MyComponent>
    ));
    expect(wrapper.contains(<div className="unique" />)).to.equal(true);
  });

  it('simulates click events', () => {
    const onButtonClick = sinon.spy();
    const wrapper = shallow(<Foo onButtonClick={onButtonClick} />);
    wrapper.find('button').simulate('click');
    expect(onButtonClick).to.have.property('callCount', 1);
  });
});

Read the full API Documentation

Full DOM Rendering

import React from 'react';
import sinon from 'sinon';
import { expect } from 'chai';
import { mount } from 'enzyme';

import Foo from './Foo';

describe('<Foo />', () => {
  it('allows us to set props', () => {
    const wrapper = mount(<Foo bar="baz" />);
    expect(wrapper.props().bar).to.equal('baz');
    wrapper.setProps({ bar: 'foo' });
    expect(wrapper.props().bar).to.equal('foo');
  });

  it('simulates click events', () => {
    const onButtonClick = sinon.spy();
    const wrapper = mount((
      <Foo onButtonClick={onButtonClick} />
    ));
    wrapper.find('button').simulate('click');
    expect(onButtonClick).to.have.property('callCount', 1);
  });

  it('calls componentDidMount', () => {
    sinon.spy(Foo.prototype, 'componentDidMount');
    const wrapper = mount(<Foo />);
    expect(Foo.prototype.componentDidMount).to.have.property('callCount', 1);
    Foo.prototype.componentDidMount.restore();
  });
});

Read the full API Documentation

Static Rendered Markup

import React from 'react';
import { expect } from 'chai';
import { render } from 'enzyme';

import Foo from './Foo';

describe('<Foo />', () => {
  it('renders three `.foo-bar`s', () => {
    const wrapper = render(<Foo />);
    expect(wrapper.find('.foo-bar')).to.have.lengthOf(3);
  });

  it('renders the title', () => {
    const wrapper = render(<Foo title="unique" />);
    expect(wrapper.text()).to.contain('unique');
  });
});

Read the full API Documentation

React Hooks support

Enzyme supports react hooks with some limitations in .shallow() due to upstream issues in React's shallow renderer:

  • useEffect() and useLayoutEffect() don't get called in the React shallow renderer. Related issue

  • useCallback() doesn't memoize callback in React shallow renderer. Related issue

ReactTestUtils.act() wrap

If you're using React 16.8+ and .mount(), Enzyme will wrap apis including .simulate(), .setProps(), .setContext(), .invoke() with ReactTestUtils.act() so you don't need to manually wrap it.

A common pattern to trigger handlers with .act() and assert is:

const wrapper = mount(<SomeComponent />);
act(() => wrapper.prop('handler')());
wrapper.update();
expect(/* ... */);

We cannot wrap the result of .prop() (or .props()) with .act() in Enzyme internally since it will break the equality of the returned value.
However, you could use .invoke() to simplify the code:

const wrapper = mount(<SomeComponent />);
wrapper.invoke('handler')();
expect(/* ... */);

Future

Enzyme Future

Contributing

See the Contributors Guide

In the wild

Organizations and projects using enzyme can list themselves here.

License

MIT

enzyme

Author: Leland Richardson

Description: JavaScript Testing utilities for React

Homepage: https://airbnb.io/enzyme/

Createdabout 4 years ago
Last Updated15 days ago
LicenseMIT
Maintainers8
Releases54
Direct Dependenciesarray.prototype.flat, cheerio, enzyme-shallow-equal, function.prototype.name, has, html-element-map, is-boolean-object, is-callable, is-number-object, is-regex, is-string, is-subset, lodash.escape, lodash.isequal, object-inspect, object-is, object.assign, object.entries, object.values, raf, rst-selector-parser and string.prototype.trim
Keywordsjavascript, shallow rendering, shallowRender, test, reactjs, react, flux, testing, test utils, assertion helpers, tdd and mocha
README

Enzyme

Join the chat at https://gitter.im/airbnb/enzyme

npm Version License Build Status Coverage Status

Enzyme is a JavaScript Testing utility for React that makes it easier to test your React Components' output.
You can also manipulate, traverse, and in some ways simulate runtime given the output.

Enzyme's API is meant to be intuitive and flexible by mimicking jQuery's API for DOM manipulation
and traversal.

Upgrading from Enzyme 2.x or React < 16

Are you here to check whether or not Enzyme is compatible with React 16? Are you currently using
Enzyme 2.x? Great! Check out our migration guide for help
moving on to Enzyme v3 where React 16 is supported.

Installation

To get started with enzyme, you can simply install it via npm. You will need to install enzyme
along with an Adapter corresponding to the version of react (or other UI Component library) you
are using. For instance, if you are using enzyme with React 16, you can run:

npm i --save-dev enzyme enzyme-adapter-react-16

Each adapter may have additional peer dependencies which you will need to install as well. For instance,
enzyme-adapter-react-16 has peer dependencies on react and react-dom.

At the moment, Enzyme has adapters that provide compatibility with React 16.x, React 15.x,
React 0.14.x and React 0.13.x.

The following adapters are officially provided by enzyme, and have the following compatibility with
React:

Enzyme Adapter Package React semver compatibility
enzyme-adapter-react-16 ^16.4.0-0
enzyme-adapter-react-16.3 ~16.3.0-0
enzyme-adapter-react-16.2 ~16.2
enzyme-adapter-react-16.1 ~16.0.0-0 || ~16.1
enzyme-adapter-react-15 ^15.5.0
enzyme-adapter-react-15.4 15.0.0-0 - 15.4.x
enzyme-adapter-react-14 ^0.14.0
enzyme-adapter-react-13 ^0.13.0

Finally, you need to configure enzyme to use the adapter you want it to use. To do this, you can use
the top level configure(...) API.

import Enzyme from 'enzyme';
import Adapter from 'enzyme-adapter-react-16';

Enzyme.configure({ adapter: new Adapter() });

3rd Party Adapters

It is possible for the community to create additional (non-official) adapters that will make enzyme
work with other libraries. If you have made one and it's not included in the list below, feel free
to make a PR to this README and add a link to it! The known 3rd party adapters are:

Adapter Package For Library Status
enzyme-adapter-preact-pure preact (stable)
enzyme-adapter-inferno inferno (work in progress)

Running Enzyme Tests

Enzyme is unopinionated regarding which test runner or assertion library you use, and should be
compatible with all major test runners and assertion libraries out there. The documentation and
examples for enzyme use mocha and chai, but you
should be able to extrapolate to your framework of choice.

If you are interested in using enzyme with custom assertions and convenience functions for
testing your React components, you can consider using:

Using Enzyme with Mocha

Using Enzyme with Karma

Using Enzyme with Browserify

Using Enzyme with SystemJS

Using Enzyme with Webpack

Using Enzyme with JSDOM

Using Enzyme with React Native

Using Enzyme with Jest

Using Enzyme with Lab

Using Enzyme with Tape and AVA

Basic Usage

Shallow Rendering

import React from 'react';
import { expect } from 'chai';
import { shallow } from 'enzyme';
import sinon from 'sinon';

import MyComponent from './MyComponent';
import Foo from './Foo';

describe('<MyComponent />', () => {
  it('renders three <Foo /> components', () => {
    const wrapper = shallow(<MyComponent />);
    expect(wrapper.find(Foo)).to.have.lengthOf(3);
  });

  it('renders an `.icon-star`', () => {
    const wrapper = shallow(<MyComponent />);
    expect(wrapper.find('.icon-star')).to.have.lengthOf(1);
  });

  it('renders children when passed in', () => {
    const wrapper = shallow((
      <MyComponent>
        <div className="unique" />
      </MyComponent>
    ));
    expect(wrapper.contains(<div className="unique" />)).to.equal(true);
  });

  it('simulates click events', () => {
    const onButtonClick = sinon.spy();
    const wrapper = shallow(<Foo onButtonClick={onButtonClick} />);
    wrapper.find('button').simulate('click');
    expect(onButtonClick).to.have.property('callCount', 1);
  });
});

Read the full API Documentation

Full DOM Rendering

import React from 'react';
import sinon from 'sinon';
import { expect } from 'chai';
import { mount } from 'enzyme';

import Foo from './Foo';

describe('<Foo />', () => {
  it('allows us to set props', () => {
    const wrapper = mount(<Foo bar="baz" />);
    expect(wrapper.props().bar).to.equal('baz');
    wrapper.setProps({ bar: 'foo' });
    expect(wrapper.props().bar).to.equal('foo');
  });

  it('simulates click events', () => {
    const onButtonClick = sinon.spy();
    const wrapper = mount((
      <Foo onButtonClick={onButtonClick} />
    ));
    wrapper.find('button').simulate('click');
    expect(onButtonClick).to.have.property('callCount', 1);
  });

  it('calls componentDidMount', () => {
    sinon.spy(Foo.prototype, 'componentDidMount');
    const wrapper = mount(<Foo />);
    expect(Foo.prototype.componentDidMount).to.have.property('callCount', 1);
    Foo.prototype.componentDidMount.restore();
  });
});

Read the full API Documentation

Static Rendered Markup

import React from 'react';
import { expect } from 'chai';
import { render } from 'enzyme';

import Foo from './Foo';

describe('<Foo />', () => {
  it('renders three `.foo-bar`s', () => {
    const wrapper = render(<Foo />);
    expect(wrapper.find('.foo-bar')).to.have.lengthOf(3);
  });

  it('renders the title', () => {
    const wrapper = render(<Foo title="unique" />);
    expect(wrapper.text()).to.contain('unique');
  });
});

Read the full API Documentation

React Hooks support

Enzyme supports react hooks with some limitations in .shallow() due to upstream issues in React's shallow renderer:

  • useEffect() and useLayoutEffect() don't get called in the React shallow renderer. Related issue

  • useCallback() doesn't memoize callback in React shallow renderer. Related issue

ReactTestUtils.act() wrap

If you're using React 16.8+ and .mount(), Enzyme will wrap apis including .simulate(), .setProps(), .setContext(), .invoke() with ReactTestUtils.act() so you don't need to manually wrap it.

A common pattern to trigger handlers with .act() and assert is:

const wrapper = mount(<SomeComponent />);
act(() => wrapper.prop('handler')());
wrapper.update();
expect(/* ... */);

We cannot wrap the result of .prop() (or .props()) with .act() in Enzyme internally since it will break the equality of the returned value.
However, you could use .invoke() to simplify the code:

const wrapper = mount(<SomeComponent />);
wrapper.invoke('handler')();
expect(/* ... */);

Future

Enzyme Future

Contributing

See the Contributors Guide

In the wild

Organizations and projects using enzyme can list themselves here.

License

MIT

file-loader

Author: Tobias Koppers @sokra

Description: A file loader module for webpack

Homepage: https://github.com/webpack-contrib/file-loader

Createdover 7 years ago
Last Updatedabout 1 month ago
LicenseMIT
Maintainers7
Releases47
Direct Dependenciesloader-utils and schema-utils
Keywordswebpack
This README is too long to show.

@babel/polyfill

Author: Sebastian McKenzie

Description: Provides polyfills necessary for a full ES2015+ environment

Homepage: https://babeljs.io/

Createdabout 2 years ago
Last Updatedabout 2 months ago
LicenseMIT
Maintainers6
Releases41
Direct Dependenciescore-js and regenerator-runtime
README

@babel/polyfill

Provides polyfills necessary for a full ES2015+ environment

This package has been deprecated in favor of separate inclusion of required parts of core-js and regenerator-runtime. See our website @babel/polyfill for more information.

See our website @babel/polyfill for more information or the issues associated with this package.

Install

Using npm:

npm install --save @babel/polyfill

or using yarn:

yarn add @babel/polyfill 

jest-styled-components

Author: Michele Bertoli

Description: Jest utilities for Styled Components

Homepage: http://npmjs.com/package/jest-styled-components

Createdalmost 3 years ago
Last Updatedabout 2 months ago
LicenseMIT
Maintainers4
Releases92
Direct Dependenciescss

@babel/plugin-transform-runtime

Author: Unknown

Description: Externalise references to helpers and builtins, automatically polyfilling your code without polluting globals

Homepage: http://npmjs.com/package/@babel/plugin-transform-runtime

Createdabout 2 years ago
Last Updated27 days ago
LicenseMIT
Maintainers6
Releases47
Direct Dependencies@babel/helper-module-imports, @babel/helper-plugin-utils, resolve and semver
Keywordsbabel-plugin
README

@babel/plugin-transform-runtime

Externalise references to helpers and builtins, automatically polyfilling your code without polluting globals

See our website @babel/plugin-transform-runtime for more information.

Install

Using npm:

npm install --save-dev @babel/plugin-transform-runtime

or using yarn:

yarn add @babel/plugin-transform-runtime --dev

jest

Author: Unknown

Description: Delightful JavaScript Testing.

Homepage: https://jestjs.io/

Createdalmost 8 years ago
Last Updated3 months ago
LicenseMIT
Maintainers5
Releases222
Direct Dependenciesimport-local and jest-cli
Keywordsava, babel, coverage, easy, expect, facebook, immersive, instant, jasmine, jest, jsdom, mocha, mocking, painless, qunit, runner, sandboxed, snapshot, tap, tape, test, testing, typescript and watch

@babel/plugin-syntax-dynamic-import

Author: Unknown

Description: Allow parsing of import()

Homepage: http://npmjs.com/package/@babel/plugin-syntax-dynamic-import

Createdabout 2 years ago
Last Updatedabout 1 month ago
LicenseMIT
Maintainers6
Releases36
Direct Dependencies@babel/helper-plugin-utils
Keywordsbabel-plugin
README

@babel/plugin-syntax-dynamic-import

Allow parsing of import()

See our website @babel/plugin-syntax-dynamic-import for more information.

Install

Using npm:

npm install --save-dev @babel/plugin-syntax-dynamic-import

or using yarn:

yarn add @babel/plugin-syntax-dynamic-import --dev

json-loader

Author: Tobias Koppers @sokra

Description: json loader module for webpack

Homepage: https://github.com/webpack/json-loader#readme

Createdalmost 8 years ago
Last Updated7 months ago
LicenseMIT
Maintainers8
Releases18
README

npm
node
deps
tests
coverage
chat

JSON Loader

Install

npm install --save-dev json-loader

⚠️ Since webpack >= v2.0.0, importing of JSON files will work by default. You might still want to use this if you use a custom file extension. See the v1.0.0 -> v2.0.0 Migration Guide for more information

Usage

Inline

const json = require('json-loader!./file.json');

Configuration (recommended)

const json = require('./file.json');

webpack.config.js

module.exports = {
  module: {
    loaders: [
      {
        test: /\.json$/,
        loader: 'json-loader'
      }
    ]
  }
}

Maintainer


Tobias Koppers

@babel/plugin-proposal-object-rest-spread

Author: Unknown

Description: Compile object rest and spread to ES5

Homepage: http://npmjs.com/package/@babel/plugin-proposal-object-rest-spread

Createdabout 2 years ago
Last Updated16 days ago
LicenseMIT
Maintainers6
Releases51
Direct Dependencies@babel/helper-plugin-utils and @babel/plugin-syntax-object-rest-spread
Keywordsbabel-plugin
README

@babel/plugin-proposal-object-rest-spread

Compile object rest and spread to ES5

See our website @babel/plugin-proposal-object-rest-spread for more information.

Install

Using npm:

npm install --save-dev @babel/plugin-proposal-object-rest-spread

or using yarn:

yarn add @babel/plugin-proposal-object-rest-spread --dev

react-addons-test-utils

Author: Unknown

Description: This package provides the React TestUtils add-on.

Homepage: https://github.com/facebook/react#readme

Createdover 4 years ago
Last Updatedalmost 2 years ago
LicenseMIT
Maintainers5
Releases59
Keywordsreact and react-addon
README

react-addons-test-utils

This package provides the React TestUtils add-on.

See https://facebook.github.io/react/docs/test-utils.html for more information.

This package is deprecated as of version 15.5.0:

  • TestUtils have been moved to react-dom/test-utils
  • Shallow renderer has been moved to react-test-renderer/shallow

@babel/plugin-proposal-class-properties

Author: Unknown

Description: This plugin transforms static class properties as well as properties declared with the property initializer syntax

Homepage: http://npmjs.com/package/@babel/plugin-proposal-class-properties

Createdabout 2 years ago
Last Updatedabout 1 month ago
LicenseMIT
Maintainers6
Releases47
Direct Dependencies@babel/helper-create-class-features-plugin and @babel/helper-plugin-utils
Keywordsbabel-plugin
README

@babel/plugin-proposal-class-properties

This plugin transforms static class properties as well as properties declared with the property initializer syntax

See our website @babel/plugin-proposal-class-properties for more information.

Install

Using npm:

npm install --save-dev @babel/plugin-proposal-class-properties

or using yarn:

yarn add @babel/plugin-proposal-class-properties --dev

react-test-renderer

Author: Unknown

Description: React package for snapshot testing.

Homepage: https://reactjs.org/

Createdover 3 years ago
Last Updated16 days ago
LicenseMIT
Maintainers11
Releases162
Direct Dependenciesobject-assign, prop-types, react-is and scheduler
Keywordsreact, react-native and react-testing

@babel/core

Author: Sebastian McKenzie

Description: Babel compiler core.

Homepage: https://babeljs.io/

Createdabout 2 years ago
Last Updated16 days ago
LicenseMIT
Maintainers6
Releases61
Direct Dependencies@babel/code-frame, @babel/generator, @babel/helpers, @babel/parser, @babel/template, @babel/traverse, @babel/types, convert-source-map, debug, json5, lodash, resolve, semver and source-map
Keywords6to5, babel, classes, const, es6, harmony, let, modules, transpile, transpiler, var, babel-core and compiler
README

@babel/core

Babel compiler core.

See our website @babel/core for more information or the issues associated with this package.

Install

Using npm:

npm install --save-dev @babel/core

or using yarn:

yarn add @babel/core --dev

stats-webpack-plugin

Author: Daniel Perez Alvarez

Description: Write the stats of a build to a file.

Homepage: https://github.com/unindented/stats-webpack-plugin#readme

Createdabout 5 years ago
Last Updatedover 1 year ago
LicenseMIT
Maintainers1
Releases19
Direct Dependencieslodash
Keywordsstats and webpack
README

Stats plugin for webpack Version Build Status Dependency Status

Writes the stats of a build to a file.

Installation

$ npm install --save-dev stats-webpack-plugin

Usage

var StatsPlugin = require('stats-webpack-plugin');

module.exports = {
  plugins: [
    new StatsPlugin('stats.json', {
      chunkModules: true,
      exclude: [/node_modules[\\\/]react/]
    })
  ]
};

Give webpack the --profile flag or set profile: true in webpack.config to get detailed timing measurements.
See Webpack Profiling for more detail.

API

new StatsPlugin(path: string, [options])
  • path: The path of the result file, relative to your output folder.
  • options: Options passed to stats.toJson

Meta

Contributors

License

Copyright (c) 2014 Daniel Perez Alvarez (unindented.org). This is free software, and may be redistributed under the terms specified in the LICENSE file.

@babel/cli

Author: Sebastian McKenzie

Description: Babel command line.

Homepage: https://babeljs.io/

Createdabout 2 years ago
Last Updated16 days ago
LicenseMIT
Maintainers6
Releases52
Direct Dependenciescommander, convert-source-map, fs-readdir-recursive, glob, lodash, make-dir, slash, source-map and chokidar
Keywords6to5, babel, es6, transpile, transpiler, babel-cli and compiler
README

@babel/cli

Babel command line.

See our website @babel/cli for more information or the issues associated with this package.

Install

Using npm:

npm install --save-dev @babel/cli

or using yarn:

yarn add @babel/cli --dev

style-loader

Author: Tobias Koppers @sokra

Description: style loader module for webpack

Homepage: https://github.com/webpack-contrib/style-loader

Createdover 7 years ago
Last Updated9 days ago
LicenseMIT
Maintainers8
Releases60
Direct Dependenciesloader-utils and schema-utils
Keywordswebpack
This README is too long to show.

This deploy contains the following PRs:

webpack-cli

Author: Unknown

Description: CLI for webpack & friends

Homepage: https://github.com/webpack/webpack-cli#readme

Createdover 4 years ago
Last Updatedabout 2 months ago
LicenseMIT
Maintainers4
Releases89
Direct Dependencieschalk, cross-spawn, enhanced-resolve, findup-sync, global-modules, import-local, interpret, loader-utils, supports-color, v8-compile-cache and yargs
Keywordswebpack, cli, scaffolding, module, bundler and web

babel-plugin-module-resolver

Author: Tommy Leunen

Description: Module resolver plugin for Babel

Homepage: https://github.com/tleunen/babel-plugin-module-resolver#readme

Createdover 3 years ago
Last Updated23 days ago
LicenseMIT
Maintainers1
Releases24
Direct Dependenciesfind-babel-config, glob, pkg-up, reselect and resolve
Keywordsbabel, babel-plugin, module, resolver, alias, rewrite, resolve, rename, mapping, require and import
README

babel-plugin-module-resolver

Maintenance Status NPM version Build Status Linux Build Status Windows Coverage Status

A Babel plugin to add a new resolver for your modules when compiling your code using Babel. This plugin allows you to add new "root" directories that contain your modules. It also allows you to setup a custom alias for directories, specific files, or even other npm modules.

Description

This plugin can simplify the require/import paths in your project. For example, instead of using complex relative paths like ../../../../utils/my-utils, you can write utils/my-utils. It will allow you to work faster since you won't need to calculate how many levels of directory you have to go up before accessing the file.

// Use this:
import MyUtilFn from 'utils/MyUtilFn';
// Instead of that:
import MyUtilFn from '../../../../utils/MyUtilFn';

// And it also work with require calls
// Use this:
const MyUtilFn = require('utils/MyUtilFn');
// Instead of that:
const MyUtilFn = require('../../../../utils/MyUtilFn');

Getting started

Install the plugin

$ npm install --save-dev babel-plugin-module-resolver

Specify the plugin in your .babelrc with the custom root or alias. Here's an example:

{
  "plugins": [
    ["module-resolver", {
      "root": ["./src"],
      "alias": {
        "test": "./test",
        "underscore": "lodash"
      }
    }]
  ]
}

.babelrc.js version
Specify the plugin in your .babelrc.js file with the custom root or alias. Here's an example:


const plugins = [
  [
    require.resolve('babel-plugin-module-resolver'),
    {
      root: ["./src/"],
      alias: {
        "test": "./test"
      }
    }
    
  ]

];

Good example: // https://gist.github.com/nodkz/41e189ff22325a27fe6a5ca81df2cb91

Documentation

babel-plugin-module-resolver can be configured and controlled easily, check the documentation for more details

Are you a plugin author (e.g. IDE integration)? We have documented the exposed functions for use in your plugins!

ESLint plugin

If you're using ESLint, you should use eslint-plugin-import, and eslint-import-resolver-babel-module to remove falsy unresolved modules. If you want to have warnings when aliased modules are being imported by their relative paths, you can use eslint-plugin-module-resolver.

Editors autocompletion

  • Atom: Uses atom-autocomplete-modules and enable the babel-plugin-module-resolver option.
  • IntelliJ/WebStorm: You can add custom resources root directories, make sure it matches what you have in this plugin.
  • VS Code: Configure the path mapping in jsconfig.json (tsconfig.json for TypeScript), e.g.:
{
  "compilerOptions": {
    "baseUrl": ".",
    "paths": {
      "*": ["src/*"],
      "test/*": ["test/*"],
      "underscore": ["lodash"]
    }
  }
}

License

MIT, see LICENSE.md for details.

Who is using babel-plugin-module-resolver ?

Are you also using it? Send a PR!

Generated by 🚫 dangerJS against c0f3b47

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants