import-js

A tool to simplify importing JS modules

MIT License

Downloads
1.2K
Stars
525
Committers
31

Bot releases are visible (Hide)

import-js - v2.3.0

Published by trotzig over 7 years ago

  • Improve support for packages that are npm linked (or symlinked in some other way)
  • Support scoped packages (e.g. @company-name/foobar
  • Improve recursive finding of exports from package dependencies

Thanks to @dcporter for providing all the context needed to make this release happen, and in general for always providing us with important findings and words of encouragement. ❤️

import-js - v2.2.2

Published by trotzig over 7 years ago

  • Fix issues when running import-js on windows machines
  • Stop treating built-in jsx elements (e.g. <div>, <input>) as undefined
import-js - v2.2.1

Published by trotzig over 7 years ago

  • Fix finding exports defined through Object.defineProperty
  • Fix goto for relative paths
  • Fix finding exports from webpack module
import-js - v2.2.0

Published by trotzig over 7 years ago

  • Fix bug where identifiers used above their definition would be subject for importing
  • Custom importStatementFormatter functions are now passed a moduleName
  • Prevent (some instances of) stale caches after npm install
  • Resolve aliases that look like package dependencies
  • Strip out excludes when importing (as well as when populating cache).
import-js - v2.1.3

Published by lencioni over 7 years ago

  • Fix bug with handling object spread syntax in parsed files
import-js - v2.1.2

Published by trotzig over 7 years ago

Changes:

  • Fix support for namespaced (import * as foo from 'foo';) imports
  • Pick first file for goto if there are multiple matches.
import-js - v2.1.1

Published by trotzig over 7 years ago

Changes:

  • Fix bug with paths when watchman is not being used
import-js - v2.1.0

Published by trotzig over 7 years ago

Import-js now automatically finds your named exports.

import-js - v2.0.1

Published by trotzig almost 8 years ago

This version contains a bugfix for globals not being recognized as a known configuration option.

import-js - v2.0.0

Published by trotzig almost 8 years ago

Breaking changes:

  • The lookupPaths configuration option has been removed. Use moduleNameFormatter instead to strip out potential prefixes from the path.
  • The stripFromPath configuration option has also been removed in favor of moduleNameFormatter.
  • const is now the default declarationKeyword in node environments.
  • snake_case configuration is no longer supported. It's been deprecated for a while but now finally removed.
  • The importjsd CLI command will now default to show help text instead of starting. Use importjsd run to start it.
  • Local configuration is no longer supported. It's been deprecated for a while but now finally removed. Use a function if you need to use different configuration on different parts of the directory tree.

Added features:

  • "star" type imports are now recognized (e.g. import * from 'foo';)
  • Imports without trailing semicolons are also recognized. If you want to strip out semicolons from the resulting import statements, use ...
  • ... importStatementFormatter, a new configuration option that you can use to modify the resulting import statement. E.g. importStatementFormatter({ importStatement }) => importStatement.replace(/;$/, '').

Other highlights:

  • The dependency on eslint has been removed in favor of using the babylon parser directly to find variables to import. This means faster fixImports, more robust import statement parsing and no pesky eslint version mismatch issues (see #354).
import-js - v1.1.2

Published by trotzig almost 8 years ago

This version fixes an issue with goto not resolving to the right file path.

import-js - v1.1.1

Published by trotzig about 8 years ago

import-js - v1.1.0

Published by lencioni about 8 years ago

Features:

  • Add support for imports with side-effects. This adds a new
    configuration option moduleSideEffectImports that can be used to
    auto-inject these imports when running fix-imports.
  • Add moduleNameFormatter configuration option.
  • Add meteor environment.
  • Add support for JavaScript configuration files and allow configuration
    options to be functions.
  • Add importjsd logpath.

Deprecations:

  • Deprecate .importjs.json in favor of .importjs.js.

Fixes:

  • Prevent normalizePath from skipping dot-files.
import-js - v1.0.1

Published by trotzig over 8 years ago

Changes:

  • Support for a dynamic working directory (needed by the Atom plugin)
  • New meteor environment (work still under progress to fully support Meteor)

Dev changes:

  • Update to Jest 13
import-js - v1.0.0

Published by trotzig over 8 years ago

This version is focused on speeding up ImportJS. Key changes:

import-js - 0.8.0

Published by trotzig over 8 years ago

This version adds support for running import-js on Windows machines.

import-js - 0.7.4

Published by trotzig over 8 years ago

Changes:

  • Fix goto not working correctly in Sublime
  • Fix relative imports for named exports and aliases
import-js - 0.7.3

Published by lencioni over 8 years ago

  • Fix bug that prevented paths to files within packages from being resolved correctly for goto.
  • Add flow annotations
  • Remove underscore from dependencies
  • Update dependencies
  • Improve mocking strategy in tests
import-js - 0.7.2

Published by trotzig over 8 years ago

Fixes an issue with how we read file content from stdin.

import-js - 0.7.1

Published by trotzig over 8 years ago

Breaking change: all configuration keys are now camelCased instead of snake_cased.

Hotfix for relative paths. They weren't working as they should when the path to the current file was passed in with an absolute path (e.g. /home/apps/todo-list/foo.js). This should fix issues with relative paths in the Sublime plugin.

Package Rankings
Top 4.84% on Npmjs.org
Top 6.68% on Proxy.golang.org
Badges
Extracted from project README
npm Version License Build Status Test Coverage