rollup-plugin-typescript2
Advanced tools
Comparing version 0.31.2 to 0.32.0
@@ -25,2 +25,3 @@ import * as tsTypes from "typescript"; | ||
fileExists(path: string): boolean; | ||
realpath(path: string): string; | ||
getTypeRootsVersion(): number; | ||
@@ -27,0 +28,0 @@ directoryExists(directoryName: string): boolean; |
@@ -0,4 +1,3 @@ | ||
import { PluginImpl } from "rollup"; | ||
import { IOptions } from "./ioptions"; | ||
import { Partial } from "./partial"; | ||
import { PluginImpl } from "rollup"; | ||
declare type RPT2Options = Partial<IOptions>; | ||
@@ -5,0 +4,0 @@ export { RPT2Options }; |
@@ -0,3 +1,3 @@ | ||
import * as tsTypes from "typescript"; | ||
import { tsModule } from "./tsproxy"; | ||
import * as tsTypes from "typescript"; | ||
export interface ICustomTransformer { | ||
@@ -4,0 +4,0 @@ before?: tsTypes.TransformerFactory<tsTypes.SourceFile>; |
@@ -0,3 +1,3 @@ | ||
import { PluginContext } from "rollup"; | ||
import { IContext, VerbosityLevel } from "./context"; | ||
import { PluginContext } from "rollup"; | ||
export declare class RollupContext implements IContext { | ||
@@ -4,0 +4,0 @@ private verbosity; |
@@ -0,3 +1,3 @@ | ||
import * as tsTypes from "typescript"; | ||
import { IContext } from "./context"; | ||
import * as tsTypes from "typescript"; | ||
export interface ICode { | ||
@@ -4,0 +4,0 @@ code: string; |
{ | ||
"name": "rollup-plugin-typescript2", | ||
"version": "0.31.2", | ||
"version": "0.32.0", | ||
"description": "Seamless integration between Rollup and TypeScript. Now with errors.", | ||
@@ -29,11 +29,13 @@ "main": "dist/rollup-plugin-typescript2.cjs.js", | ||
"build-self": "rimraf dist/* && rollup -c rollup.config.self.js", | ||
"lint": "tslint -c ./tslint.json src/*.ts ./*.js" | ||
"lint": "tslint -c ./tslint.json src/*.ts __tests__/*.ts ./*.js", | ||
"test": "jest", | ||
"test:watch": "jest --watch", | ||
"test:coverage": "jest --coverage" | ||
}, | ||
"dependencies": { | ||
"@rollup/pluginutils": "^4.1.2", | ||
"@yarn-tool/resolve-package": "^1.0.40", | ||
"find-cache-dir": "^3.3.2", | ||
"fs-extra": "^10.0.0", | ||
"resolve": "^1.20.0", | ||
"tslib": "^2.3.1" | ||
"tslib": "^2.4.0" | ||
}, | ||
@@ -45,6 +47,9 @@ "peerDependencies": { | ||
"devDependencies": { | ||
"@types/colors": "1.2.1", | ||
"@jest/globals": "^28.0.3", | ||
"@rollup/plugin-commonjs": "21.1.0", | ||
"@rollup/plugin-node-resolve": "13.2.1", | ||
"@types/find-cache-dir": "^2.0.0", | ||
"@types/fs-extra": "8.0.1", | ||
"@types/graphlib": "2.1.7", | ||
"@types/jest": "^27.5.0", | ||
"@types/lodash": "4.14.161", | ||
@@ -57,13 +62,12 @@ "@types/node": "8.0.47", | ||
"graphlib": "2.1.8", | ||
"jest": "^28.0.0", | ||
"lodash": "4.17.21", | ||
"object-hash": "2.2.0", | ||
"object-hash": "3.0.0", | ||
"rimraf": "3.0.2", | ||
"rollup": "^2.48.0", | ||
"@rollup/plugin-commonjs": "17.1.0", | ||
"@rollup/plugin-node-resolve": "11.2.0", | ||
"rollup": "^2.70.2", | ||
"rollup-plugin-re": "1.0.7", | ||
"rollup-plugin-typescript2": "0.31.1", | ||
"semver": "7.3.5", | ||
"rollup-plugin-typescript2": "0.31.2", | ||
"ts-jest": "^28.0.0", | ||
"tslint": "6.1.3", | ||
"typescript": "^4.5.4" | ||
"typescript": "^4.6.3" | ||
}, | ||
@@ -70,0 +74,0 @@ "repository": { |
# rollup-plugin-typescript2 | ||
[![npm-version](https://img.shields.io/npm/v/rollup-plugin-typescript2.svg?maxAge=259200)](https://npmjs.org/package/rollup-plugin-typescript2) | ||
![npm-monthly-downloads](https://img.shields.io/npm/dm/rollup-plugin-typescript2.svg?maxAge=259200) | ||
[![Codeship Status](https://app.codeship.com/projects/fe9cf8f0-e8d4-0134-ec88-4e3d33dcd7ed/status?branch=master)](https://app.codeship.com/projects/207445) | ||
[![Codacy Badge](https://api.codacy.com/project/badge/Grade/e19b72ab9658405bbfb32dd6d65d1856)](https://www.codacy.com/app/zolenkoe/rollup-plugin-typescript2?utm_source=github.com&utm_medium=referral&utm_content=ezolenko/rollup-plugin-typescript2&utm_campaign=Badge_Grade) | ||
[![npm-monthly-downloads](https://img.shields.io/npm/dm/rollup-plugin-typescript2.svg?maxAge=259200)](https://npmjs.org/package/rollup-plugin-typescript2) | ||
[![Node.js CI](https://github.com/ezolenko/rollup-plugin-typescript2/workflows/Node.js%20CI/badge.svg)](https://github.com/ezolenko/rollup-plugin-typescript2/actions?query=workflow%3A"Node.js+CI") | ||
@@ -46,5 +44,6 @@ | ||
* `noResolve`: false | ||
* `noEmit`: false | ||
* `noEmit`: false (Rollup controls emit) | ||
* `noEmitOnError`: false (Rollup controls emit. See [#254](https://github.com/ezolenko/rollup-plugin-typescript2/issues/254) and the `abortOnError` plugin option below) | ||
* `inlineSourceMap`: false (see [#71](https://github.com/ezolenko/rollup-plugin-typescript2/issues/71)) | ||
* `outDir`: `./placeholder` in cache root, see [83](https://github.com/ezolenko/rollup-plugin-typescript2/issues/83) and [Microsoft/TypeScript/issues/24715](https://github.com/Microsoft/TypeScript/issues/24715) | ||
* `outDir`: `./placeholder` in cache root, see [#83](https://github.com/ezolenko/rollup-plugin-typescript2/issues/83) and [Microsoft/TypeScript#24715](https://github.com/Microsoft/TypeScript/issues/24715) | ||
* `declarationDir`: Rollup's `output.file` or `output.dir` (*only if `useTsconfigDeclarationDir` is false in the plugin options*) | ||
@@ -64,18 +63,18 @@ * `moduleResolution`: `node` (*`classic` is [deprecated](https://www.typescriptlang.org/docs/handbook/module-resolution.html). It also breaks this plugin, see [#12](https://github.com/ezolenko/rollup-plugin-typescript2/issues/12) and [#14](https://github.com/ezolenko/rollup-plugin-typescript2/issues/14)*) | ||
#### rollup-plugin-node-resolve | ||
#### @rollup/plugin-node-resolve | ||
Must be before rollup-plugin-typescript2 in the plugin list, especially when `browser: true` option is used, see [#66](https://github.com/ezolenko/rollup-plugin-typescript2/issues/66) | ||
#### rollup-plugin-commonjs | ||
#### @rollup/plugin-commonjs | ||
See explanation for `rollupCommonJSResolveHack` option below. | ||
#### rollup-plugin-babel | ||
#### @rollup/plugin-babel | ||
This plugin transpiles code, but doesn't change file extension. Babel plugin, even though it claims it processes all files, only looks at code with those extensions by default: `.js,.jsx,.es6,.es,.mjs`. To workaround add `ts` and `tsx` to the list of babel extensions. | ||
This plugin transpiles code, but doesn't change file extensions. `@rollup/plugin-babel` only looks at code with these extensions [by default](https://github.com/rollup/plugins/tree/master/packages/babel#extensions): `.js,.jsx,.es6,.es,.mjs`. To workaround this, add `.ts` and `.tsx` to its list of extensions. | ||
```js | ||
... | ||
// ... | ||
import { DEFAULT_EXTENSIONS } from '@babel/core'; | ||
... | ||
// ... | ||
babel({ | ||
@@ -88,3 +87,3 @@ extensions: [ | ||
}), | ||
... | ||
// ... | ||
``` | ||
@@ -120,3 +119,3 @@ | ||
This is a [deep merge](https://lodash.com/docs/4.17.4#merge) (objects are merged, arrays are concatenated, primitives are replaced, etc), increase `verbosity` to 3 and look for `parsed tsconfig` if you get something unexpected. | ||
This is a [deep merge](https://lodash.com/docs/4.17.4#merge) (objects are merged, arrays are merged by index, primitives are replaced, etc), increase `verbosity` to 3 and look for `parsed tsconfig` if you get something unexpected. | ||
@@ -165,7 +164,7 @@ * `tsconfig`: `undefined` | ||
On windows typescript resolver favors POSIX path, while commonjs plugin (and maybe others?) uses native path as module id. This can result in `namedExports` being ignored if rollup happened to use typescript's resolution. Set to true to pass resolved module path through `resolve()` to match up with `rollup-plugin-commonjs`. | ||
`rollup-plugin-commonjs` fixed this in `10.1.0`, so projects using this option who update to new version will be broken again. | ||
This also works around the similar bug affecting code splitting (see [rollup/issues/3094](https://github.com/rollup/rollup/issues/3094)). | ||
This also works around the similar bug affecting code splitting (see [rollup/rollup#3094](https://github.com/rollup/rollup/issues/3094)). | ||
* `objectHashIgnoreUnknownHack`: false | ||
@@ -178,8 +177,8 @@ | ||
If true, declaration files will be emitted in the directory given in the tsconfig. If false, the declaration files will be placed inside the destination directory given in the Rollup configuration. | ||
Set to false if any other rollup plugins need access to declaration files. | ||
* `typescript`: typescript module installed with the plugin | ||
* `typescript`: peerDependency | ||
When typescript version installed by the plugin (latest 2.x) is unacceptable, you can import your own typescript module and pass it in as `typescript: require("path/to/other/typescript")`. Must be 2.0+, things might break if transpiler interfaces changed enough from what the plugin was built against. | ||
If you'd like to use a different version of TS than the peerDependency, you can import a different TypeScript module and pass it in as `typescript: require("path/to/other/typescript")`. Must be TS 2.0+, things might break if transpiler interfaces changed enough from what the plugin was built against. | ||
@@ -190,3 +189,3 @@ * `transformers`: `undefined` | ||
Transformers will likely be available in tsconfig eventually, so this is not a stable interface, see [Microsoft/TypeScript/issues/14419](https://github.com/Microsoft/TypeScript/issues/14419). | ||
Transformers will likely be available in tsconfig eventually, so this is not a stable interface, see [Microsoft/TypeScript#14419](https://github.com/Microsoft/TypeScript/issues/14419). | ||
@@ -225,30 +224,4 @@ For example, integrating [kimamula/ts-transformer-keys](https://github.com/kimamula/ts-transformer-keys): | ||
### Reporting bugs | ||
### Reporting bugs and Contributing | ||
Report any bugs on github: <https://github.com/ezolenko/rollup-plugin-typescript2/issues>. | ||
Attach your `tsconfig.json`, `package.json` (for versions of dependencies), rollup script and anything else that could influence module resolution, ambient types and typescript compilation. | ||
Check if problem is reproducible after running `npm prune` to clear any rogue types from npm_modules (by default typescript grabs all ambient types). | ||
Check if you get the same problem with `clean` option set to true (might indicate a bug in the cache). | ||
If makes sense, check if running `tsc` directly produces similar results. | ||
Attach plugin output with `verbosity` option set to 3 (this will list all files being transpiled and their imports). | ||
### Contributing | ||
Use the normal github process of forking, making a branch and creating a PR when ready. Fix all linting problems (run `npm lint`), fix any failed checks that are run on the PR (basically lint right now). Use an editor that supports editorconfig, or match the settings from `.editorconfig` file manually. | ||
Fastest way to test changes is to do a self build, the plugin is part of its own build system: | ||
- make changes | ||
- run `npm build` (uses last released version on npm) | ||
- check that you get expected changes in `dist` | ||
- run `npm build-self` (uses fresh local build) | ||
- check `dist` for the expected changes | ||
- run `npm build-self` _again_ to make sure plugin built by new version can still build itself | ||
If `build-self` breaks at some point, fix the problem and restart from `build` step (a known good copy). | ||
This repo badly needs unittests and integration tests with various scenarios and expected outcomes though. | ||
See [CONTRIBUTING.md](./CONTRIBUTING.md) |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
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
Dynamic require
Supply chain riskDynamic require can indicate the package is performing dangerous or unsafe dynamic code execution.
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
7
16
4
3870649
24
39
42152
220
- Removed@yarn-tool/resolve-package@^1.0.40
- Removed@types/node@22.8.6(transitive)
- Removed@yarn-tool/resolve-package@1.0.47(transitive)
- Removedfind-up@5.0.0(transitive)
- Removedlocate-path@6.0.0(transitive)
- Removedp-limit@3.1.0(transitive)
- Removedp-locate@5.0.0(transitive)
- Removedpath-is-network-drive@1.0.21(transitive)
- Removedpath-strip-sep@1.0.18(transitive)
- Removedpkg-dir@5.0.0(transitive)
- Removedundici-types@6.19.8(transitive)
- Removedupath2@3.1.20(transitive)
- Removedyocto-queue@0.1.0(transitive)
Updatedtslib@^2.4.0