ts-import-plugin
Advanced tools
Comparing version 1.6.1 to 1.6.2
import * as ts from 'typescript'; | ||
export interface Options { | ||
libraryName?: string; | ||
style?: boolean | 'css' | string | ((name: string) => string); | ||
style?: boolean | 'css' | 'css.web' | string | ((name: string) => string | false); | ||
libraryDirectory?: ((name: string) => string) | string; | ||
libraryOverride?: boolean; | ||
camel2DashComponentName?: boolean; | ||
@@ -7,0 +8,0 @@ camel2UnderlineComponentName?: boolean; |
@@ -66,3 +66,3 @@ "use strict"; | ||
var astNodes = []; | ||
var libraryName = options.libraryName; | ||
var libraryName = options.libraryName, libraryOverride = options.libraryOverride; | ||
var _importName = struct.importName; | ||
@@ -83,6 +83,6 @@ var importName = options.camel2UnderlineComponentName | ||
} | ||
var importPath = join(libraryName, libraryDirectory); | ||
var importPath = !libraryOverride ? join(libraryName, libraryDirectory) : libraryDirectory; | ||
try { | ||
require.resolve(importPath, { | ||
paths: [process.cwd()].concat(options.resolveContext), | ||
paths: tslib_1.__spreadArrays([process.cwd()], options.resolveContext), | ||
}); | ||
@@ -121,6 +121,7 @@ var scriptNode = ts.createImportDeclaration(undefined, undefined, ts.createImportClause(struct.variableName || !options.transformToDefaultImport ? undefined : ts.createIdentifier(struct.importName), struct.variableName | ||
resolveContext: [], | ||
libraryOverride: false, | ||
}; | ||
function createTransformer(_options) { | ||
if (_options === void 0) { _options = {}; } | ||
var mergeDefault = function (options) { return (tslib_1.__assign({}, defaultOptions, options)); }; | ||
var mergeDefault = function (options) { return (tslib_1.__assign(tslib_1.__assign({}, defaultOptions), options)); }; | ||
var optionsArray = Array.isArray(_options) | ||
@@ -127,0 +128,0 @@ ? _options.map(function (options) { return mergeDefault(options); }) |
{ | ||
"name": "ts-import-plugin", | ||
"version": "1.6.1", | ||
"version": "1.6.2", | ||
"description": "babel-plugin-import TypeScript version", | ||
@@ -9,9 +9,7 @@ "main": "index.js", | ||
"build": "rm -rf lib && tsc -p src/tsconfig.json", | ||
"cover": "rm -rf ./coverage ./.nyc_output && nyc --reporter=html --reporter=lcov --exclude=node_modules --exclude=test mocha && nyc report", | ||
"cover": "rm -rf ./coverage ./.nyc_output && nyc --reporter=html --reporter=lcov --exclude=node_modules --exclude=test ava && nyc report", | ||
"lint": "tslint -c ./tslint.json -p ./src/tsconfig.json", | ||
"prepare": "npm run build", | ||
"start": "rm -rf dist && NODE_ENV=production webpack", | ||
"test": "mocha", | ||
"watch": "tsc -p ./src/tsconfig.json -w --diagnostics", | ||
"postinstall": "opencollective-postinstall || true" | ||
"test": "ava", | ||
"watch": "tsc -p ./src/tsconfig.json -w --diagnostics" | ||
}, | ||
@@ -35,42 +33,49 @@ "repository": { | ||
"@istanbuljs/nyc-config-typescript": "^0.1.3", | ||
"@types/chai": "^4.1.7", | ||
"@types/lodash": "^4.14.134", | ||
"@types/material-ui": "^0.21.6", | ||
"@types/mocha": "^5.2.7", | ||
"@types/node": "^12.0.8", | ||
"@types/react": "^16.8.22", | ||
"@types/react-dom": "^16.8.4", | ||
"antd": "^3.19.6", | ||
"chai": "^4.2.0", | ||
"coveralls": "^3.0.4", | ||
"css-loader": "^3.0.0", | ||
"husky": "^2.4.1", | ||
"lint-staged": "^8.2.1", | ||
"lodash": "^4.17.11", | ||
"@types/lodash": "^4.14.149", | ||
"@types/material-ui": "^0.21.7", | ||
"@types/node": "^12.12.14", | ||
"@types/react": "^16.9.14", | ||
"@types/react-dom": "^16.9.4", | ||
"antd": "^3.26.0", | ||
"ava": "^2.4.0", | ||
"codecov": "^3.6.1", | ||
"css-loader": "^3.2.1", | ||
"husky": "^3.1.0", | ||
"lint-staged": "^9.5.0", | ||
"lodash": "^4.17.15", | ||
"lodash-es": "^4.17.15", | ||
"material-ui": "^0.20.2", | ||
"mini-css-extract-plugin": "^0.7.0", | ||
"mocha": "^6.1.4", | ||
"mini-css-extract-plugin": "^0.8.0", | ||
"nyc": "^14.1.1", | ||
"prettier": "^1.18.2", | ||
"react": "^16.8.6", | ||
"react-dom": "^16.8.6", | ||
"rxjs": "^6.5.2", | ||
"style-loader": "^0.23.1", | ||
"ts-loader": "^6.0.4", | ||
"ts-node": "^8.3.0", | ||
"tslint": "^5.17.0", | ||
"prettier": "^1.19.1", | ||
"react": "^16.12.0", | ||
"react-dom": "^16.12.0", | ||
"rxjs": "^6.5.3", | ||
"source-map-support": "^0.5.16", | ||
"style-loader": "^1.0.1", | ||
"ts-loader": "^6.2.1", | ||
"ts-node": "^8.5.4", | ||
"tslint": "^5.20.1", | ||
"tslint-eslint-rules": "^5.4.0", | ||
"typescript": "^3.5.2", | ||
"webpack": "^4.35.0", | ||
"webpack-bundle-analyzer": "^3.3.2", | ||
"webpack-cli": "^3.3.4" | ||
"typescript": "^3.7.3", | ||
"webpack": "^4.41.2", | ||
"webpack-bundle-analyzer": "^3.6.0", | ||
"webpack-cli": "^3.3.10" | ||
}, | ||
"dependencies": { | ||
"tslib": "^1.10.0", | ||
"opencollective-postinstall": "^2.0.2" | ||
"tslib": "^1.10.0" | ||
}, | ||
"standard": { | ||
"globals": [ | ||
"describe", | ||
"it" | ||
"ava": { | ||
"compileEnhancements": false, | ||
"extensions": [ | ||
"ts" | ||
], | ||
"require": [ | ||
"ts-node/register" | ||
], | ||
"files": [ | ||
"test/specs.ts" | ||
], | ||
"sources": [ | ||
"src/**/*.ts" | ||
] | ||
@@ -77,0 +82,0 @@ }, |
[![Financial Contributors on Open Collective](https://opencollective.com/ts-import-plugin/all/badge.svg?label=financial+contributors)](https://opencollective.com/ts-import-plugin) [![npm version](https://badge.fury.io/js/ts-import-plugin.svg)](https://www.npmjs.com/package/ts-import-plugin) | ||
[![CircleCI](https://circleci.com/gh/Brooooooklyn/ts-import-plugin.svg?style=svg)](https://circleci.com/gh/Brooooooklyn/ts-import-plugin) | ||
[![Coverage Status](https://coveralls.io/repos/github/Brooooooklyn/ts-import-plugin/badge.svg)](https://coveralls.io/github/Brooooooklyn/ts-import-plugin) | ||
[![codecov](https://codecov.io/gh/Brooooooklyn/ts-import-plugin/branch/master/graph/badge.svg)](https://codecov.io/gh/Brooooooklyn/ts-import-plugin) | ||
# ts-import-plugin | ||
[![Greenkeeper badge](https://badges.greenkeeper.io/Brooooooklyn/ts-import-plugin.svg)](https://greenkeeper.io/) | ||
Modular import plugin for TypeScript, compatible with antd, antd-mobile and so on. | ||
@@ -115,3 +113,3 @@ | ||
default `false` | ||
- libraryDirectory `string | ((name: string) => string)` | ||
- libraryDirectory `string | ((name: string) => string)` | ||
@@ -125,3 +123,6 @@ default `'lib'` | ||
default `false` | ||
- libraryOverride `boolean` | ||
default `false` | ||
example: | ||
@@ -128,0 +129,0 @@ |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Install scripts
Supply chain riskInstall scripts are run when the package is installed. The majority of malware in npm is hidden in install scripts.
Found 1 instance in 1 package
24229
1
31
174
319
0
- Removedopencollective-postinstall@^2.0.2
- Removedopencollective-postinstall@2.0.3(transitive)