🎯 MapView v2.0 - Global Deployment Ready

 MAJOR FEATURES:
• Auto-zoom intelligence với smart bounds fitting
• Enhanced 3D GPS markers với pulsing effects
• Professional route display với 6-layer rendering
• Status-based parking icons với availability indicators
• Production-ready build optimizations

🗺️ AUTO-ZOOM FEATURES:
• Smart bounds fitting cho GPS + selected parking
• Adaptive padding (50px) cho visual balance
• Max zoom control (level 16) để tránh quá gần
• Dynamic centering khi không có selection

🎨 ENHANCED VISUALS:
• 3D GPS marker với multi-layer pulse effects
• Advanced parking icons với status colors
• Selection highlighting với animation
• Dimming system cho non-selected items

🛣️ ROUTE SYSTEM:
• OpenRouteService API integration
• Multi-layer route rendering (glow, shadow, main, animated)
• Real-time distance & duration calculation
• Visual route info trong popup

📱 PRODUCTION READY:
• SSR safe với dynamic imports
• Build errors resolved
• Global deployment via Vercel
• Optimized performance

🌍 DEPLOYMENT:
• Vercel: https://whatever-ctk2auuxr-phong12hexdockworks-projects.vercel.app
• Bundle size: 22.8 kB optimized
• Global CDN distribution
• HTTPS enabled

💾 VERSION CONTROL:
• MapView-v2.0.tsx backup created
• MAPVIEW_VERSIONS.md documentation
• Full version history tracking
This commit is contained in:
2025-07-20 19:52:16 +07:00
parent 3203463a6a
commit c65cc97a33
64624 changed files with 7199453 additions and 6462 deletions

View File

@@ -0,0 +1,112 @@
{
"env": {
"node": true
},
"parser": "@typescript-eslint/parser",
"plugins": [
"eslint-plugin-import",
"eslint-plugin-jsdoc",
"@typescript-eslint"
],
"extends": ["prettier"],
"rules": {
"@typescript-eslint/consistent-type-assertions": "error",
"@typescript-eslint/explicit-function-return-type": [
"error",
{
"allowExpressions": true,
"allowTypedFunctionExpressions": true,
"allowHigherOrderFunctions": false,
"allowDirectConstAssertionInArrowFunctions": true,
"allowConciseArrowFunctionExpressionsStartingWithVoid": true
}
],
"@typescript-eslint/explicit-module-boundary-types": [
"error",
{
"allowArgumentsExplicitlyTypedAsAny": true,
"allowDirectConstAssertionInArrowFunctions": true,
"allowHigherOrderFunctions": false,
"allowTypedFunctionExpressions": false
}
],
"@typescript-eslint/naming-convention": [
"error",
{
"selector": [
"classProperty",
"objectLiteralProperty",
"typeProperty",
"classMethod",
"objectLiteralMethod",
"typeMethod",
"accessor",
"enumMember"
],
"format": null,
"modifiers": ["requiresQuotes"]
}
],
"@typescript-eslint/no-empty-function": "error",
"@typescript-eslint/no-explicit-any": "error",
"@typescript-eslint/no-namespace": "error",
"@typescript-eslint/no-parameter-properties": "error",
"@typescript-eslint/no-require-imports": "off",
"@typescript-eslint/no-shadow": "error",
"@typescript-eslint/no-unused-expressions": "error",
"@typescript-eslint/no-var-requires": "off",
"@typescript-eslint/prefer-namespace-keyword": "error",
"@typescript-eslint/triple-slash-reference": "error",
"@typescript-eslint/typedef": [
"error",
{
"parameter": true,
"propertyDeclaration": true
}
],
"curly": "error",
"default-case": "error",
"eqeqeq": ["error", "always"],
"guard-for-in": "error",
"id-denylist": [
"error",
"any",
"Number",
"number",
"String",
"string",
"Boolean",
"boolean",
"Undefined",
"undefined"
],
"id-match": "error",
"import/no-default-export": "error",
"jsdoc/check-alignment": "error",
"jsdoc/check-indentation": "error",
"max-len": [
"error",
{
"code": 160
}
],
"max-lines": ["error", 800],
"no-bitwise": "error",
"no-caller": "error",
"no-cond-assign": "error",
"no-debugger": "error",
"no-empty": "error",
"no-eval": "error",
"no-fallthrough": "error",
"no-invalid-this": "error",
"no-new-wrappers": "error",
"no-redeclare": "error",
"no-underscore-dangle": "error",
"no-unsafe-finally": "error",
"no-unused-labels": "error",
"no-var": "error",
"one-var": ["error", "never"],
"radix": "error",
"use-isnan": "error"
}
}

View File

@@ -0,0 +1,62 @@
name: CI
on:
push:
branches: [master]
pull_request:
branches: [master]
jobs:
lint:
name: Linting Checks
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v1
- name: Setup NodeJs
uses: actions/setup-node@v2
with:
node-version: "lts/*"
- name: Install Dependencies
run: yarn install --frozen-lockfile
- name: Run Linting Checks
run: yarn lint
test:
name: "Test - Node: ${{ matrix.node_version }} - OS: ${{ matrix.os }}"
runs-on: ubuntu-latest
strategy:
fail-fast: true
matrix:
os:
- "ubuntu-latest"
node_version:
- "16"
- "18"
- "20"
steps:
- uses: actions/checkout@v1
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
- name: yarn install
run: yarn install --frozen-lockfile
- name: build
run: yarn build
- name: test
run: yarn test-coverage
- name: Report coverage
uses: codecov/codecov-action@v1
with:
file: coverage/lcov.info

View File

@@ -0,0 +1 @@
yarn lint-staged

View File

@@ -0,0 +1 @@
20

View File

@@ -0,0 +1 @@
nodejs 20.9.0

View File

@@ -0,0 +1,231 @@
# Change Log
All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](http://keepachangelog.com/) and this
project adheres to [Semantic Versioning](http://semver.org/).
## [Unreleased](https://github.com/dividab/tsconfig-paths-webpack-plugin/compare/v4.2.0...master)
## [4.2.0](https://github.com/dividab/tsconfig-paths-webpack-plugin/compare/v4.1.0...v4.2.0) - 2024-11-15
### Added
- Update typing for webpack@^5.94.0 [#110](https://github.com/dividab/tsconfig-paths-webpack-plugin/pull/110). Thanks to [@rostislav-simonik](https://github.com/rostislav-simonik) for this PR!
### Fixed
- Fix typing of mainFields option [#105](https://github.com/dividab/tsconfig-paths-webpack-plugin/pull/106). Thanks to [@chenjiahan](https://github.com/chenjiahan) for this PR!
## [4.1.0](https://github.com/dividab/tsconfig-paths-webpack-plugin/compare/v4.0.1...v4.1.0) - 2023-07-11
### Added
- Remove warning on missing baseUrl, which tsconfig-paths ^4.0.0 doesn't require anymore [#105](https://github.com/dividab/tsconfig-paths-webpack-plugin/pull/105). Thanks to [@sverweij](https://github.com/sverweij) for this PR!
- Add support for multiple tsconfig paths [#79](https://github.com/dividab/tsconfig-paths-webpack-plugin/pull/79). Thanks to [@lynch16](https://github.com/lynch16) for this PR!
### Fixed
- Update tsconfig file name in .npmignore [#100](https://github.com/dividab/tsconfig-paths-webpack-plugin/pull/100). Thanks to [@tcd](https://github.com/tcd) for this PR!
## [4.0.1](https://github.com/dividab/tsconfig-paths-webpack-plugin/compare/v4.0.0...v4.0.1) - 2023-03-09
- Update tsconfig-paths [#103](https://github.com/dividab/tsconfig-paths-webpack-plugin/pull/103). Thanks to [@rippedspine](https://github.com/rippedspine) for this PR!
## [4.0.0](https://github.com/dividab/tsconfig-paths-webpack-plugin/compare/v3.5.2...v4.0.0) - 2022-07-29
- chore: update tsconfig-paths dependency [#90](https://github.com/dividab/tsconfig-paths-webpack-plugin/pull/90). Thanks to [@MichaelDeBoey](https://github.com/MichaelDeBoey) for this PR!
- Update webpack and remove temp types [#92](https://github.com/dividab/tsconfig-paths-webpack-plugin/pull/92). Thanks to [@hungtcs](https://github.com/hungtcs) for this PR!
- Eslint (#95)
- Upgrade ci and jest (#96)
## [3.5.2](https://github.com/dividab/tsconfig-paths-webpack-plugin/compare/v3.5.1...v3.5.2) - 2021-11-13
### Fixed
- Fix incorrect resolution with relative imports on project dependencies [#85](https://github.com/dividab/tsconfig-paths-webpack-plugin/pull/85). Thanks to [@voliva](https://github.com/voliva) for this fix!
- Remove `console.log` from `plugin.ts` [#72](https://github.com/dividab/tsconfig-paths-webpack-plugin/pull/72). Thanks to [@visualfanatic](https://github.com/visualfanatic) for this fix!
## [3.5.1](https://github.com/dividab/tsconfig-paths-webpack-plugin/compare/v3.5.0...v3.5.1) - 2021-03-16
### Fixed
- Remove `console.log` from `plugin.ts` [#72](https://github.com/dividab/tsconfig-paths-webpack-plugin/pull/72). Thanks to [@visualfanatic](https://github.com/visualfanatic) for this fix!
## [3.5.0](https://github.com/dividab/tsconfig-paths-webpack-plugin/compare/v3.4.1...v3.5.0) - 2021-03-15
### Added
- Copied webpack 5 types into `plugins.temp.types.ts` [#51](https://github.com/dividab/tsconfig-paths-webpack-plugin/pull/70). Thanks to [@Brian-McBride](https://github.com/Brian-McBride) for this addition!
## [3.4.1](https://github.com/dividab/tsconfig-paths-webpack-plugin/compare/v3.4.0...v3.4.1) - 2021-03-13
### Fixed
- Use prepare instead of postinstall for husky.
## [3.4.0](https://github.com/dividab/tsconfig-paths-webpack-plugin/compare/v3.3.0...v3.4.0) - 2021-03-13
### Added
- Support for Webpack 5, see [#51](https://github.com/dividab/tsconfig-paths-webpack-plugin/pull/66). Fixes [#50](https://github.com/dividab/tsconfig-paths-webpack-plugin/issues/61). Thanks to [@Brian-McBride](https://github.com/Brian-McBride) for this addition!
## [3.3.0](https://github.com/dividab/tsconfig-paths-webpack-plugin/compare/3.2.0...v3.3.0) - 2020-07-29
### Added
- Add readJson fallback to support custom file systems, see [#51](https://github.com/dividab/tsconfig-paths-webpack-plugin/pull/51). Fixes [#50](https://github.com/dividab/tsconfig-paths-webpack-plugin/issues/50). Thanks to [@JakeSidSmith](https://github.com/JakeSidSmith) for this addition!
## [3.2.0](https://github.com/dividab/tsconfig-paths-webpack-plugin/compare/3.1.4...3.2.0) - 2018-06-12
### Added
- Add `mainFields` option [#21](https://github.com/dividab/tsconfig-paths-webpack-plugin/pull/21), fixes [#20](https://github.com/dividab/tsconfig-paths-webpack-plugin/issues/20). Thanks to [@christoffer](https://github.com/christoffer) for this addition!
## [3.1.4](https://github.com/dividab/tsconfig-paths-webpack-plugin/compare/3.1.3...3.1.4) - 2018-06-04
### Fixed
- Add undeclared dependency on `enhanced-resolve` to `dependencies`, see #19. Thanks to [@jbboehr](https://github.com/jbboehr) for this fix!
## [3.1.3](https://github.com/dividab/tsconfig-paths-webpack-plugin/compare/3.1.2...3.1.3) - 2018-05-14
### Fixed
- Fix exports so all types of imports works (commonjs require and typescript import).
## [3.1.2](https://github.com/dividab/tsconfig-paths-webpack-plugin/compare/3.1.1...3.1.2) - 2018-05-14
### Fixed
- Add types field to package.json.
## [3.1.1](https://github.com/dividab/tsconfig-paths-webpack-plugin/compare/3.1.0...3.1.1) - 2018-05-14
### Fixed
- Add named typescript export.
## [3.1.0](https://github.com/dividab/tsconfig-paths-webpack-plugin/compare/3.0.4...3.1.0) - 2018-05-14
### Added
- Typescript typings, see [#16](https://github.com/dividab/tsconfig-paths/issues/16).
## [3.0.4](https://github.com/dividab/tsconfig-paths-webpack-plugin/compare/3.0.4...3.0.4) - 2018-04-17
### Fixed
- Add missing module dependency [#15](https://github.com/dividab/tsconfig-paths/pull/15). Thanks to [@darlanalves](https://github.com/darlanalves) for this fix!
## [3.0.3](https://github.com/dividab/tsconfig-paths-webpack-plugin/compare/3.0.2...3.0.3) - 2018-03-31
### Fixed
- Fix configFileName not working as expected, see https://github.com/dividab/tsconfig-paths/issues/31.
- Upgraded tsconfig-paths to 3.2.0 which includes the fix in https://github.com/dividab/tsconfig-paths/pull/32.
## [3.0.2](https://github.com/dividab/tsconfig-paths-webpack-plugin/compare/3.0.1...3.0.2) - 2018-03-14
### Fixed
- Upgraded tsconfig-paths to 3.1.3 which includes the fix in https://github.com/dividab/tsconfig-paths/pull/30.
## [3.0.1](https://github.com/dividab/tsconfig-paths-webpack-plugin/compare/3.0.0...3.0.1) - 2018-03-13
### Fixed
- Upgraded tsconfig-paths to 3.1.2 which includes the fix in https://github.com/dividab/tsconfig-paths/pull/29.
- Fix for the new webpack 4 code to prevent callback from firing multiple times, see [#11](https://github.com/dividab/tsconfig-paths-webpack-plugin/issues/11). Thanks to [@Nayni](https://github.com/Nayni) for this fix! (See PR [#12](https://github.com/dividab/tsconfig-paths-webpack-plugin/pull/12)).
## [3.0.0](https://github.com/dividab/tsconfig-paths-webpack-plugin/compare/2.0.0...3.0.0) - 2018-03-13
### Added
- Proper support for webpack 4. See [#9](https://github.com/dividab/tsconfig-paths-webpack-plugin/issues/9). Thanks to [@Nayni](https://github.com/Nayni) for adding this! (See PR [#10](https://github.com/dividab/tsconfig-paths-webpack-plugin/pull/10))
## [2.0.0](https://github.com/dividab/tsconfig-paths-webpack-plugin/compare/1.4.0...2.0.0) - 2018-01-13
### Changed
- Performance enhancements:
- Using async versions of tsconfig-paths package matchPath functions.
- Using webpack's cached filesystem. Should give better performance.
## [1.4.0](https://github.com/dividab/tsconfig-paths-webpack-plugin/compare/1.3.1...1.4.0)
### Changed
- Only log startup message when `logLevel` is set to `info`. See [#6](https://github.com/dividab/tsconfig-paths-webpack-plugin/issues/6).
## [1.3.1](https://github.com/dividab/tsconfig-paths-webpack-plugin/compare/1.3.0...1.3.1)
### Added
- Upgraded to tsconfig-paths 2.7.2.
## [1.3.0](https://github.com/dividab/tsconfig-paths-webpack-plugin/compare/1.2.0...1.3.0)
### Added
- Upgraded to tsconfig-paths 2.7.1.
## [1.2.0](https://github.com/dividab/tsconfig-paths-webpack-plugin/compare/1.1.0...1.2.0)
### Added
- Added option for `baseUrl`.
## [1.1.0](https://github.com/dividab/tsconfig-paths-webpack-plugin/compare/1.0.0...1.1.0)
### Added
- Added option for `extensions`.
## [1.0.0](https://github.com/dividab/tsconfig-paths-webpack-plugin/compare/0.4.0...1.0.0)
### Changed
- Log path to tsconfig.json at warn log level so it is logged as default.
## [0.4.0](https://github.com/dividab/tsconfig-paths-webpack-plugin/compare/0.3.0...0.4.0)
### Changed
- Rename plugin class to TsconfigPathsPlugin (lower case s, breaking change)
- Load config using tsconfig-paths.
### Removed
- Remove compiler option (it was not used)
## [0.3.0](https://github.com/dividab/tsconfig-paths-webpack-plugin/compare/0.2.0...0.3.0)
### Changed
- Use package tsconfig-paths to resolve paths.
## [0.2.0](https://github.com/dividab/tsconfig-paths-webpack-plugin/compare/0.1.1...0.2.0)
### Changed
- Internal refactor
## [0.1.1](https://github.com/dividab/tsconfig-paths-webpack-plugin/compare/0.1.0...0.1.1)
### Added
- Include files.
## 0.1.0
### Added
- First release.

View File

@@ -0,0 +1,21 @@
The MIT License (MIT)
Copyright (c) 2016 Jonas Kello
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

View File

@@ -0,0 +1,151 @@
# tsconfig-paths-webpack-plugin
[![npm version][version-image]][version-url]
[![build][build-image]][build-url]
[![Coverage Status][codecov-image]][codecov-url]
[![code style: prettier][prettier-image]][prettier-url]
[![MIT license][license-image]][license-url]
Use this to load modules whose location is specified in the `paths` section of
`tsconfig.json` when using webpack. This package provides the functionality of
the [tsconfig-paths](https://www.npmjs.com/package/tsconfig-paths) package but
as a webpack plug-in.
Using this plugin means that you should no longer need to add `alias` entries in
your `webpack.config.js` which correspond to the `paths` entries in your
`tsconfig.json`. This plugin creates those `alias` entries for you, so you don't
have to!
## How to install
> NOTE: If you are using webpack 4 you need to use version >= 3.0.0 (which is aso backwards compatible with webpack 3).
```
yarn add --dev tsconfig-paths-webpack-plugin
```
or
```
npm install --save-dev tsconfig-paths-webpack-plugin
```
## How to use
In your webpack config add this:
```js
const TsconfigPathsPlugin = require('tsconfig-paths-webpack-plugin');
module.exports = {
...
resolve: {
plugins: [new TsconfigPathsPlugin({/* options: see below */})]
}
...
}
```
**Notice that the plugin is placed in the `resolve.plugins` section of the configuration.** `tsconfig-paths-webpack-plugin` is a resolve plugin and should only be placed in this part of the configuration. Don't confuse this with the plugins array at the root of the webpack configuration object.
If you're using `allowJs` in `tsconfig.json`, or allow other non-TS extensions in webpack, **make sure you set `extensions` option in sync with your webpack config.**
## Options
#### configFile _(string) (default='tsconfig.json')_
Allows you to specify where to find the TypeScript configuration file.
You may provide
- just a file name. The plugin will search for the filename using the built-in
logic in the `tsconfig-paths` package. The search will start at `cwd`.
- a relative path to the configuration file. It will be resolved relative to
`cwd`.
- an absolute path to the configuration file.
> The use of `cwd` as default above is not optimal but we've found no better
> solution yet. If you have a suggestion please file an issue.
#### extensions _(string[]) (default=[".ts", ".tsx"])_
An array of the extensions that will be tried during resolve. Ideally this would be the same as the extensions from the webpack config but it seems resolver plug-ins does not have access to this information so you need to specify it again for the plugin.
#### baseUrl _(string) (default=undefined)_
This allows you to override the `baseUrl` found in tsconfig.json. The baseUrl specifies from which directory `paths` should be resolved. So this option enabled you to resolve from another directory than the one where tsconfig.json is located. This can be useful if you want to use webpack with `tsc --watch` instead of a typescript loader. If this option is `undefined` then the `baseUrl` from tsconfig.json will be used.
#### mainFields _((string | string[])[]) (default=["main"])_
An array of the field names that should be considered when resolving packages. Ideally this would be the same as the mainFields from the webpack config but it seems resolver plug-ins does not have access to this infomration so you need to specify it again for the plugin.
#### silent _(boolean) (default=false)_
If true, no console.log messages will be emitted. Note that most error messages
are emitted via webpack which is not affected by this flag.
#### logLevel _(string) (default=warn)_
Can be `info`, `warn` or `error` which limits the log output to the specified
log level. Beware of the fact that errors are written to stderr and everything
else is written to stderr (or stdout if logInfoToStdOut is true).
#### colors _(boolean) (default=true)_
If `false`, disables built-in colors in logger messages.
#### logInfoToStdOut _(boolean) (default=false)_
This is important if you read from stdout or stderr and for proper error
handling. The default value ensures that you can read from stdout e.g. via pipes
or you use webpack -j to generate json output.
#### references _(string[]) (default=undefined)
Support for [Typescript Project References](https://www.typescriptlang.org/docs/handbook/project-references.html).
## Typescript support
This package has typescript typings included. If your webpack config is using typescript, you can use this syntax to import the default export:
```ts
import TsconfigPathsPlugin from "tsconfig-paths-webpack-plugin";
```
Or you can use this syntax to import the named export:
```ts
import { TsconfigPathsPlugin } from "tsconfig-paths-webpack-plugin";
```
## How to test
To run the provided example:
```
yarn example
```
## How to publish
```
yarn version --patch
yarn version --minor
yarn version --major
```
## Prior work
This project uses work done in the
[awesome-typescript-loader](https://github.com/s-panferov/awesome-typescript-loader).
[version-image]: https://img.shields.io/npm/v/tsconfig-paths-webpack-plugin.svg?style=flat
[version-url]: https://www.npmjs.com/package/tsconfig-paths-webpack-plugin
[build-image]: https://github.com/dividab/tsconfig-paths-webpack-plugin/workflows/CI/badge.svg
[build-url]: https://github.com/dividab/tsconfig-paths-webpack-plugin/actions/workflows/ci.yml?query=branch%3Amaster
[codecov-image]: https://codecov.io/gh/dividab/tsconfig-paths-webpack-plugin/branch/master/graph/badge.svg
[codecov-url]: https://codecov.io/gh/dividab/tsconfig-paths-webpack-plugin
[prettier-image]: https://img.shields.io/badge/code_style-prettier-ff69b4.svg?style=flat
[prettier-url]: https://github.com/prettier/prettier
[license-image]: https://img.shields.io/github/license/jonaskello/tsconfig-paths-webpack-plugin.svg?style=flat
[license-url]: https://opensource.org/licenses/MIT

View File

@@ -0,0 +1,179 @@
<?xml version="1.0" encoding="UTF-8"?>
<coverage generated="1731654517492" clover="3.2.0">
<project timestamp="1731654517492" name="All files">
<metrics statements="161" coveredstatements="117" conditionals="93" coveredconditionals="62" methods="40" coveredmethods="33" elements="294" coveredelements="212" complexity="0" loc="161" ncloc="161" packages="1" files="4" classes="4"/>
<file name="index.ts" path="/home/jonkel/code/github/dividab/tsconfig-paths-webpack-plugin/src/index.ts">
<metrics statements="7" coveredstatements="0" conditionals="0" coveredconditionals="0" methods="1" coveredmethods="0"/>
<line num="1" count="0" type="stmt"/>
<line num="2" count="0" type="stmt"/>
<line num="3" count="0" type="stmt"/>
<line num="9" count="0" type="stmt"/>
<line num="10" count="0" type="stmt"/>
<line num="11" count="0" type="stmt"/>
<line num="12" count="0" type="stmt"/>
</file>
<file name="logger.ts" path="/home/jonkel/code/github/dividab/tsconfig-paths-webpack-plugin/src/logger.ts">
<metrics statements="26" coveredstatements="26" conditionals="14" coveredconditionals="11" methods="14" coveredmethods="13"/>
<line num="1" count="2" type="stmt"/>
<line num="17" count="2" type="cond" truecount="2" falsecount="0"/>
<line num="18" count="2" type="stmt"/>
<line num="19" count="2" type="stmt"/>
<line num="20" count="2" type="stmt"/>
<line num="23" count="2" type="stmt"/>
<line num="24" count="2" type="stmt"/>
<line num="26" count="2" type="stmt"/>
<line num="30" count="2" type="stmt"/>
<line num="31" count="5" type="cond" truecount="1" falsecount="1"/>
<line num="35" count="8" type="stmt"/>
<line num="37" count="2" type="stmt"/>
<line num="40" count="5" type="stmt"/>
<line num="41" count="2" type="stmt"/>
<line num="46" count="2" type="stmt"/>
<line num="51" count="5" type="cond" truecount="2" falsecount="0"/>
<line num="53" count="4" type="stmt"/>
<line num="59" count="2" type="stmt"/>
<line num="64" count="5" type="cond" truecount="1" falsecount="1"/>
<line num="65" count="1" type="stmt"/>
<line num="68" count="2" type="stmt"/>
<line num="73" count="5" type="cond" truecount="1" falsecount="1"/>
<line num="74" count="1" type="stmt"/>
<line num="77" count="2" type="stmt"/>
<line num="78" count="5" type="stmt"/>
<line num="79" count="5" type="stmt"/>
</file>
<file name="options.ts" path="/home/jonkel/code/github/dividab/tsconfig-paths-webpack-plugin/src/options.ts">
<metrics statements="14" coveredstatements="13" conditionals="1" coveredconditionals="0" methods="3" coveredmethods="3"/>
<line num="17" count="1" type="stmt"/>
<line num="33" count="1" type="stmt"/>
<line num="34" count="3" type="stmt"/>
<line num="36" count="3" type="stmt"/>
<line num="38" count="3" type="stmt"/>
<line num="48" count="3" type="stmt"/>
<line num="49" count="3" type="stmt"/>
<line num="50" count="10" type="stmt"/>
<line num="52" count="10" type="stmt"/>
<line num="53" count="10" type="cond" truecount="0" falsecount="1"/>
<line num="54" count="0" type="stmt"/>
<line num="63" count="3" type="stmt"/>
<line num="79" count="3" type="stmt"/>
<line num="84" count="3" type="stmt"/>
</file>
<file name="plugin.ts" path="/home/jonkel/code/github/dividab/tsconfig-paths-webpack-plugin/src/plugin.ts">
<metrics statements="114" coveredstatements="78" conditionals="78" coveredconditionals="51" methods="22" coveredmethods="17"/>
<line num="1" count="1" type="stmt"/>
<line num="2" count="1" type="stmt"/>
<line num="3" count="1" type="stmt"/>
<line num="4" count="1" type="stmt"/>
<line num="5" count="1" type="stmt"/>
<line num="122" count="1" type="stmt"/>
<line num="124" count="1" type="stmt"/>
<line num="127" count="3" type="stmt"/>
<line num="128" count="3" type="stmt"/>
<line num="138" count="3" type="cond" truecount="0" falsecount="1"/>
<line num="139" count="3" type="stmt"/>
<line num="141" count="3" type="stmt"/>
<line num="142" count="3" type="stmt"/>
<line num="146" count="3" type="stmt"/>
<line num="151" count="3" type="cond" truecount="2" falsecount="0"/>
<line num="152" count="3" type="cond" truecount="1" falsecount="1"/>
<line num="154" count="3" type="stmt"/>
<line num="155" count="3" type="cond" truecount="1" falsecount="0"/>
<line num="156" count="3" type="cond" truecount="2" falsecount="0"/>
<line num="157" count="3" type="cond" truecount="1" falsecount="1"/>
<line num="160" count="3" type="stmt"/>
<line num="166" count="3" type="cond" truecount="1" falsecount="0"/>
<line num="167" count="1" type="stmt"/>
<line num="168" count="1" type="cond" truecount="1" falsecount="0"/>
<line num="169" count="1" type="stmt"/>
<line num="170" count="1" type="cond" truecount="1" falsecount="0"/>
<line num="171" count="2" type="stmt"/>
<line num="172" count="1" type="stmt"/>
<line num="179" count="1" type="stmt"/>
<line num="185" count="1" type="stmt"/>
<line num="186" count="6" type="cond" truecount="0" falsecount="1"/>
<line num="187" count="0" type="stmt"/>
<line num="190" count="0" type="stmt"/>
<line num="196" count="6" type="cond" truecount="0" falsecount="1"/>
<line num="197" count="0" type="stmt"/>
<line num="202" count="0" type="stmt"/>
<line num="206" count="6" type="cond" truecount="3" falsecount="1"/>
<line num="207" count="6" type="stmt"/>
<line num="220" count="0" type="cond" truecount="0" falsecount="1"/>
<line num="222" count="0" type="stmt"/>
<line num="223" count="0" type="stmt"/>
<line num="235" count="1" type="stmt"/>
<line num="241" count="4" type="stmt"/>
<line num="242" count="4" type="cond" truecount="1" falsecount="1"/>
<line num="243" count="0" type="stmt"/>
<line num="245" count="4" type="stmt"/>
<line num="249" count="4" type="stmt"/>
<line num="263" count="6" type="stmt"/>
<line num="264" count="6" type="stmt"/>
<line num="265" count="6" type="stmt"/>
<line num="270" count="39" type="stmt"/>
<line num="272" count="39" type="cond" truecount="0" falsecount="1"/>
<line num="277" count="0" type="stmt"/>
<line num="283" count="39" type="stmt"/>
<line num="284" count="39" type="cond" truecount="1" falsecount="0"/>
<line num="288" count="27" type="cond" truecount="2" falsecount="0"/>
<line num="289" count="6" type="stmt"/>
<line num="291" count="21" type="stmt"/>
<line num="293" count="7" type="cond" truecount="1" falsecount="1"/>
<line num="294" count="7" type="stmt"/>
<line num="301" count="21" type="cond" truecount="1" falsecount="0"/>
<line num="302" count="6" type="stmt"/>
<line num="307" count="39" type="cond" truecount="2" falsecount="0"/>
<line num="309" count="39" type="stmt"/>
<line num="315" count="39" type="cond" truecount="0" falsecount="1"/>
<line num="316" count="0" type="stmt"/>
<line num="319" count="39" type="cond" truecount="1" falsecount="0"/>
<line num="320" count="21" type="stmt"/>
<line num="323" count="18" type="stmt"/>
<line num="332" count="18" type="stmt"/>
<line num="334" count="18" type="stmt"/>
<line num="343" count="18" type="cond" truecount="0" falsecount="1"/>
<line num="344" count="0" type="stmt"/>
<line num="348" count="18" type="cond" truecount="0" falsecount="1"/>
<line num="349" count="0" type="stmt"/>
<line num="352" count="18" type="stmt"/>
<line num="367" count="0" type="stmt"/>
<line num="368" count="0" type="stmt"/>
<line num="369" count="0" type="stmt"/>
<line num="370" count="0" type="stmt"/>
<line num="372" count="0" type="cond" truecount="0" falsecount="1"/>
<line num="377" count="0" type="stmt"/>
<line num="380" count="0" type="stmt"/>
<line num="386" count="0" type="cond" truecount="0" falsecount="1"/>
<line num="387" count="0" type="stmt"/>
<line num="390" count="0" type="cond" truecount="0" falsecount="1"/>
<line num="391" count="0" type="stmt"/>
<line num="394" count="0" type="stmt"/>
<line num="403" count="0" type="stmt"/>
<line num="405" count="0" type="stmt"/>
<line num="415" count="0" type="cond" truecount="0" falsecount="1"/>
<line num="416" count="0" type="stmt"/>
<line num="420" count="0" type="stmt"/>
<line num="433" count="36" type="cond" truecount="3" falsecount="0"/>
<line num="434" count="36" type="stmt"/>
<line num="437" count="0" type="stmt"/>
<line num="438" count="0" type="cond" truecount="0" falsecount="1"/>
<line num="439" count="0" type="stmt"/>
<line num="444" count="0" type="stmt"/>
<line num="446" count="0" type="stmt"/>
<line num="448" count="0" type="stmt"/>
<line num="451" count="0" type="stmt"/>
<line num="459" count="6" type="stmt"/>
<line num="460" count="36" type="stmt"/>
<line num="462" count="36" type="cond" truecount="3" falsecount="0"/>
<line num="463" count="27" type="stmt"/>
<line num="464" count="27" type="stmt"/>
<line num="466" count="9" type="stmt"/>
<line num="474" count="6" type="stmt"/>
<line num="478" count="171" type="stmt"/>
<line num="480" count="171" type="cond" truecount="1" falsecount="0"/>
<line num="481" count="138" type="stmt"/>
<line num="482" count="138" type="stmt"/>
<line num="484" count="33" type="cond" truecount="1" falsecount="1"/>
</file>
</project>
</coverage>

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,224 @@
body, html {
margin:0; padding: 0;
height: 100%;
}
body {
font-family: Helvetica Neue, Helvetica, Arial;
font-size: 14px;
color:#333;
}
.small { font-size: 12px; }
*, *:after, *:before {
-webkit-box-sizing:border-box;
-moz-box-sizing:border-box;
box-sizing:border-box;
}
h1 { font-size: 20px; margin: 0;}
h2 { font-size: 14px; }
pre {
font: 12px/1.4 Consolas, "Liberation Mono", Menlo, Courier, monospace;
margin: 0;
padding: 0;
-moz-tab-size: 2;
-o-tab-size: 2;
tab-size: 2;
}
a { color:#0074D9; text-decoration:none; }
a:hover { text-decoration:underline; }
.strong { font-weight: bold; }
.space-top1 { padding: 10px 0 0 0; }
.pad2y { padding: 20px 0; }
.pad1y { padding: 10px 0; }
.pad2x { padding: 0 20px; }
.pad2 { padding: 20px; }
.pad1 { padding: 10px; }
.space-left2 { padding-left:55px; }
.space-right2 { padding-right:20px; }
.center { text-align:center; }
.clearfix { display:block; }
.clearfix:after {
content:'';
display:block;
height:0;
clear:both;
visibility:hidden;
}
.fl { float: left; }
@media only screen and (max-width:640px) {
.col3 { width:100%; max-width:100%; }
.hide-mobile { display:none!important; }
}
.quiet {
color: #7f7f7f;
color: rgba(0,0,0,0.5);
}
.quiet a { opacity: 0.7; }
.fraction {
font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace;
font-size: 10px;
color: #555;
background: #E8E8E8;
padding: 4px 5px;
border-radius: 3px;
vertical-align: middle;
}
div.path a:link, div.path a:visited { color: #333; }
table.coverage {
border-collapse: collapse;
margin: 10px 0 0 0;
padding: 0;
}
table.coverage td {
margin: 0;
padding: 0;
vertical-align: top;
}
table.coverage td.line-count {
text-align: right;
padding: 0 5px 0 20px;
}
table.coverage td.line-coverage {
text-align: right;
padding-right: 10px;
min-width:20px;
}
table.coverage td span.cline-any {
display: inline-block;
padding: 0 5px;
width: 100%;
}
.missing-if-branch {
display: inline-block;
margin-right: 5px;
border-radius: 3px;
position: relative;
padding: 0 4px;
background: #333;
color: yellow;
}
.skip-if-branch {
display: none;
margin-right: 10px;
position: relative;
padding: 0 4px;
background: #ccc;
color: white;
}
.missing-if-branch .typ, .skip-if-branch .typ {
color: inherit !important;
}
.coverage-summary {
border-collapse: collapse;
width: 100%;
}
.coverage-summary tr { border-bottom: 1px solid #bbb; }
.keyline-all { border: 1px solid #ddd; }
.coverage-summary td, .coverage-summary th { padding: 10px; }
.coverage-summary tbody { border: 1px solid #bbb; }
.coverage-summary td { border-right: 1px solid #bbb; }
.coverage-summary td:last-child { border-right: none; }
.coverage-summary th {
text-align: left;
font-weight: normal;
white-space: nowrap;
}
.coverage-summary th.file { border-right: none !important; }
.coverage-summary th.pct { }
.coverage-summary th.pic,
.coverage-summary th.abs,
.coverage-summary td.pct,
.coverage-summary td.abs { text-align: right; }
.coverage-summary td.file { white-space: nowrap; }
.coverage-summary td.pic { min-width: 120px !important; }
.coverage-summary tfoot td { }
.coverage-summary .sorter {
height: 10px;
width: 7px;
display: inline-block;
margin-left: 0.5em;
background: url(sort-arrow-sprite.png) no-repeat scroll 0 0 transparent;
}
.coverage-summary .sorted .sorter {
background-position: 0 -20px;
}
.coverage-summary .sorted-desc .sorter {
background-position: 0 -10px;
}
.status-line { height: 10px; }
/* yellow */
.cbranch-no { background: yellow !important; color: #111; }
/* dark red */
.red.solid, .status-line.low, .low .cover-fill { background:#C21F39 }
.low .chart { border:1px solid #C21F39 }
.highlighted,
.highlighted .cstat-no, .highlighted .fstat-no, .highlighted .cbranch-no{
background: #C21F39 !important;
}
/* medium red */
.cstat-no, .fstat-no, .cbranch-no, .cbranch-no { background:#F6C6CE }
/* light red */
.low, .cline-no { background:#FCE1E5 }
/* light green */
.high, .cline-yes { background:rgb(230,245,208) }
/* medium green */
.cstat-yes { background:rgb(161,215,106) }
/* dark green */
.status-line.high, .high .cover-fill { background:rgb(77,146,33) }
.high .chart { border:1px solid rgb(77,146,33) }
/* dark yellow (gold) */
.status-line.medium, .medium .cover-fill { background: #f9cd0b; }
.medium .chart { border:1px solid #f9cd0b; }
/* light yellow */
.medium { background: #fff4c2; }
.cstat-skip { background: #ddd; color: #111; }
.fstat-skip { background: #ddd; color: #111 !important; }
.cbranch-skip { background: #ddd !important; color: #111; }
span.cline-neutral { background: #eaeaea; }
.coverage-summary td.empty {
opacity: .5;
padding-top: 4px;
padding-bottom: 4px;
line-height: 1;
color: #888;
}
.cover-fill, .cover-empty {
display:inline-block;
height: 12px;
}
.chart {
line-height: 0;
}
.cover-empty {
background: white;
}
.cover-full {
border-right: none !important;
}
pre.prettyprint {
border: none !important;
padding: 0 !important;
margin: 0 !important;
}
.com { color: #999 !important; }
.ignore-none { color: #999; font-weight: normal; }
.wrapper {
min-height: 100%;
height: auto !important;
height: 100%;
margin: 0 auto -48px;
}
.footer, .push {
height: 48px;
}

View File

@@ -0,0 +1,87 @@
/* eslint-disable */
var jumpToCode = (function init() {
// Classes of code we would like to highlight in the file view
var missingCoverageClasses = ['.cbranch-no', '.cstat-no', '.fstat-no'];
// Elements to highlight in the file listing view
var fileListingElements = ['td.pct.low'];
// We don't want to select elements that are direct descendants of another match
var notSelector = ':not(' + missingCoverageClasses.join('):not(') + ') > '; // becomes `:not(a):not(b) > `
// Selecter that finds elements on the page to which we can jump
var selector =
fileListingElements.join(', ') +
', ' +
notSelector +
missingCoverageClasses.join(', ' + notSelector); // becomes `:not(a):not(b) > a, :not(a):not(b) > b`
// The NodeList of matching elements
var missingCoverageElements = document.querySelectorAll(selector);
var currentIndex;
function toggleClass(index) {
missingCoverageElements
.item(currentIndex)
.classList.remove('highlighted');
missingCoverageElements.item(index).classList.add('highlighted');
}
function makeCurrent(index) {
toggleClass(index);
currentIndex = index;
missingCoverageElements.item(index).scrollIntoView({
behavior: 'smooth',
block: 'center',
inline: 'center'
});
}
function goToPrevious() {
var nextIndex = 0;
if (typeof currentIndex !== 'number' || currentIndex === 0) {
nextIndex = missingCoverageElements.length - 1;
} else if (missingCoverageElements.length > 1) {
nextIndex = currentIndex - 1;
}
makeCurrent(nextIndex);
}
function goToNext() {
var nextIndex = 0;
if (
typeof currentIndex === 'number' &&
currentIndex < missingCoverageElements.length - 1
) {
nextIndex = currentIndex + 1;
}
makeCurrent(nextIndex);
}
return function jump(event) {
if (
document.getElementById('fileSearch') === document.activeElement &&
document.activeElement != null
) {
// if we're currently focused on the search input, we don't want to navigate
return;
}
switch (event.which) {
case 78: // n
case 74: // j
goToNext();
break;
case 66: // b
case 75: // k
case 80: // p
goToPrevious();
break;
}
};
})();
window.addEventListener('keydown', jumpToCode);

Binary file not shown.

After

Width:  |  Height:  |  Size: 445 B

View File

@@ -0,0 +1,161 @@
<!doctype html>
<html lang="en">
<head>
<title>Code coverage report for All files</title>
<meta charset="utf-8" />
<link rel="stylesheet" href="prettify.css" />
<link rel="stylesheet" href="base.css" />
<link rel="shortcut icon" type="image/x-icon" href="favicon.png" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<style type='text/css'>
.coverage-summary .sorter {
background-image: url(sort-arrow-sprite.png);
}
</style>
</head>
<body>
<div class='wrapper'>
<div class='pad1'>
<h1>All files</h1>
<div class='clearfix'>
<div class='fl pad1y space-right2'>
<span class="strong">72.72% </span>
<span class="quiet">Statements</span>
<span class='fraction'>120/165</span>
</div>
<div class='fl pad1y space-right2'>
<span class="strong">66.66% </span>
<span class="quiet">Branches</span>
<span class='fraction'>62/93</span>
</div>
<div class='fl pad1y space-right2'>
<span class="strong">82.5% </span>
<span class="quiet">Functions</span>
<span class='fraction'>33/40</span>
</div>
<div class='fl pad1y space-right2'>
<span class="strong">72.67% </span>
<span class="quiet">Lines</span>
<span class='fraction'>117/161</span>
</div>
</div>
<p class="quiet">
Press <em>n</em> or <em>j</em> to go to the next uncovered block, <em>b</em>, <em>p</em> or <em>k</em> for the previous block.
</p>
<template id="filterTemplate">
<div class="quiet">
Filter:
<input type="search" id="fileSearch">
</div>
</template>
</div>
<div class='status-line medium'></div>
<div class="pad1">
<table class="coverage-summary">
<thead>
<tr>
<th data-col="file" data-fmt="html" data-html="true" class="file">File</th>
<th data-col="pic" data-type="number" data-fmt="html" data-html="true" class="pic"></th>
<th data-col="statements" data-type="number" data-fmt="pct" class="pct">Statements</th>
<th data-col="statements_raw" data-type="number" data-fmt="html" class="abs"></th>
<th data-col="branches" data-type="number" data-fmt="pct" class="pct">Branches</th>
<th data-col="branches_raw" data-type="number" data-fmt="html" class="abs"></th>
<th data-col="functions" data-type="number" data-fmt="pct" class="pct">Functions</th>
<th data-col="functions_raw" data-type="number" data-fmt="html" class="abs"></th>
<th data-col="lines" data-type="number" data-fmt="pct" class="pct">Lines</th>
<th data-col="lines_raw" data-type="number" data-fmt="html" class="abs"></th>
</tr>
</thead>
<tbody><tr>
<td class="file low" data-value="index.ts"><a href="index.ts.html">index.ts</a></td>
<td data-value="0" class="pic low">
<div class="chart"><div class="cover-fill" style="width: 0%"></div><div class="cover-empty" style="width: 100%"></div></div>
</td>
<td data-value="0" class="pct low">0%</td>
<td data-value="8" class="abs low">0/8</td>
<td data-value="100" class="pct high">100%</td>
<td data-value="0" class="abs high">0/0</td>
<td data-value="0" class="pct low">0%</td>
<td data-value="1" class="abs low">0/1</td>
<td data-value="0" class="pct low">0%</td>
<td data-value="7" class="abs low">0/7</td>
</tr>
<tr>
<td class="file high" data-value="logger.ts"><a href="logger.ts.html">logger.ts</a></td>
<td data-value="100" class="pic high">
<div class="chart"><div class="cover-fill cover-full" style="width: 100%"></div><div class="cover-empty" style="width: 0%"></div></div>
</td>
<td data-value="100" class="pct high">100%</td>
<td data-value="26" class="abs high">26/26</td>
<td data-value="78.57" class="pct medium">78.57%</td>
<td data-value="14" class="abs medium">11/14</td>
<td data-value="92.85" class="pct high">92.85%</td>
<td data-value="14" class="abs high">13/14</td>
<td data-value="100" class="pct high">100%</td>
<td data-value="26" class="abs high">26/26</td>
</tr>
<tr>
<td class="file high" data-value="options.ts"><a href="options.ts.html">options.ts</a></td>
<td data-value="93.33" class="pic high">
<div class="chart"><div class="cover-fill" style="width: 93%"></div><div class="cover-empty" style="width: 7%"></div></div>
</td>
<td data-value="93.33" class="pct high">93.33%</td>
<td data-value="15" class="abs high">14/15</td>
<td data-value="0" class="pct low">0%</td>
<td data-value="1" class="abs low">0/1</td>
<td data-value="100" class="pct high">100%</td>
<td data-value="3" class="abs high">3/3</td>
<td data-value="92.85" class="pct high">92.85%</td>
<td data-value="14" class="abs high">13/14</td>
</tr>
<tr>
<td class="file medium" data-value="plugin.ts"><a href="plugin.ts.html">plugin.ts</a></td>
<td data-value="68.96" class="pic medium">
<div class="chart"><div class="cover-fill" style="width: 68%"></div><div class="cover-empty" style="width: 32%"></div></div>
</td>
<td data-value="68.96" class="pct medium">68.96%</td>
<td data-value="116" class="abs medium">80/116</td>
<td data-value="65.38" class="pct medium">65.38%</td>
<td data-value="78" class="abs medium">51/78</td>
<td data-value="77.27" class="pct medium">77.27%</td>
<td data-value="22" class="abs medium">17/22</td>
<td data-value="68.42" class="pct medium">68.42%</td>
<td data-value="114" class="abs medium">78/114</td>
</tr>
</tbody>
</table>
</div>
<div class='push'></div><!-- for sticky footer -->
</div><!-- /wrapper -->
<div class='footer quiet pad2 space-top1 center small'>
Code coverage generated by
<a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
at 2024-11-15T07:08:37.481Z
</div>
<script src="prettify.js"></script>
<script>
window.onload = function () {
prettyPrint();
};
</script>
<script src="sorter.js"></script>
<script src="block-navigation.js"></script>
</body>
</html>

View File

@@ -0,0 +1,121 @@
<!doctype html>
<html lang="en">
<head>
<title>Code coverage report for index.ts</title>
<meta charset="utf-8" />
<link rel="stylesheet" href="prettify.css" />
<link rel="stylesheet" href="base.css" />
<link rel="shortcut icon" type="image/x-icon" href="favicon.png" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<style type='text/css'>
.coverage-summary .sorter {
background-image: url(sort-arrow-sprite.png);
}
</style>
</head>
<body>
<div class='wrapper'>
<div class='pad1'>
<h1><a href="index.html">All files</a> index.ts</h1>
<div class='clearfix'>
<div class='fl pad1y space-right2'>
<span class="strong">0% </span>
<span class="quiet">Statements</span>
<span class='fraction'>0/8</span>
</div>
<div class='fl pad1y space-right2'>
<span class="strong">100% </span>
<span class="quiet">Branches</span>
<span class='fraction'>0/0</span>
</div>
<div class='fl pad1y space-right2'>
<span class="strong">0% </span>
<span class="quiet">Functions</span>
<span class='fraction'>0/1</span>
</div>
<div class='fl pad1y space-right2'>
<span class="strong">0% </span>
<span class="quiet">Lines</span>
<span class='fraction'>0/7</span>
</div>
</div>
<p class="quiet">
Press <em>n</em> or <em>j</em> to go to the next uncovered block, <em>b</em>, <em>p</em> or <em>k</em> for the previous block.
</p>
<template id="filterTemplate">
<div class="quiet">
Filter:
<input type="search" id="fileSearch">
</div>
</template>
</div>
<div class='status-line low'></div>
<pre><table class="coverage">
<tr><td class="line-count quiet"><a name='L1'></a><a href='#L1'>1</a>
<a name='L2'></a><a href='#L2'>2</a>
<a name='L3'></a><a href='#L3'>3</a>
<a name='L4'></a><a href='#L4'>4</a>
<a name='L5'></a><a href='#L5'>5</a>
<a name='L6'></a><a href='#L6'>6</a>
<a name='L7'></a><a href='#L7'>7</a>
<a name='L8'></a><a href='#L8'>8</a>
<a name='L9'></a><a href='#L9'>9</a>
<a name='L10'></a><a href='#L10'>10</a>
<a name='L11'></a><a href='#L11'>11</a>
<a name='L12'></a><a href='#L12'>12</a>
<a name='L13'></a><a href='#L13'>13</a></td><td class="line-coverage quiet"><span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span></td><td class="text"><pre class="prettyprint lang-js"><span class="cstat-no" title="statement not covered" >export { <span class="cstat-no" title="statement not covered" ><span class="fstat-no" title="function not covered" >T</span>sconfigPathsPlugin </span>} from "./plugin";</span>
<span class="cstat-no" title="statement not covered" >import { TsconfigPathsPlugin } from "./plugin";</span>
<span class="cstat-no" title="statement not covered" >export default TsconfigPathsPlugin;</span>
&nbsp;
// This is to make it importable in all these ways
// const TsconfigPathsPlugin = require('tsconfig-paths-webpack-plugin');
// import TsconfigPathsPlugin from "tsconfig-paths-webpack-plugin";
// import { TsconfigPathsPlugin } from "tsconfig-paths-webpack-plugin";
const theClass = <span class="cstat-no" title="statement not covered" >require("./plugin").TsconfigPathsPlugin;</span>
<span class="cstat-no" title="statement not covered" >theClass.TsconfigPathsPlugin = TsconfigPathsPlugin;</span>
<span class="cstat-no" title="statement not covered" >theClass.default = TsconfigPathsPlugin;</span>
<span class="cstat-no" title="statement not covered" >module.exports = theClass;</span>
&nbsp;</pre></td></tr></table></pre>
<div class='push'></div><!-- for sticky footer -->
</div><!-- /wrapper -->
<div class='footer quiet pad2 space-top1 center small'>
Code coverage generated by
<a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
at 2024-11-15T07:08:37.481Z
</div>
<script src="prettify.js"></script>
<script>
window.onload = function () {
prettyPrint();
};
</script>
<script src="sorter.js"></script>
<script src="block-navigation.js"></script>
</body>
</html>

View File

@@ -0,0 +1,340 @@
<!doctype html>
<html lang="en">
<head>
<title>Code coverage report for logger.ts</title>
<meta charset="utf-8" />
<link rel="stylesheet" href="prettify.css" />
<link rel="stylesheet" href="base.css" />
<link rel="shortcut icon" type="image/x-icon" href="favicon.png" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<style type='text/css'>
.coverage-summary .sorter {
background-image: url(sort-arrow-sprite.png);
}
</style>
</head>
<body>
<div class='wrapper'>
<div class='pad1'>
<h1><a href="index.html">All files</a> logger.ts</h1>
<div class='clearfix'>
<div class='fl pad1y space-right2'>
<span class="strong">100% </span>
<span class="quiet">Statements</span>
<span class='fraction'>26/26</span>
</div>
<div class='fl pad1y space-right2'>
<span class="strong">78.57% </span>
<span class="quiet">Branches</span>
<span class='fraction'>11/14</span>
</div>
<div class='fl pad1y space-right2'>
<span class="strong">92.85% </span>
<span class="quiet">Functions</span>
<span class='fraction'>13/14</span>
</div>
<div class='fl pad1y space-right2'>
<span class="strong">100% </span>
<span class="quiet">Lines</span>
<span class='fraction'>26/26</span>
</div>
</div>
<p class="quiet">
Press <em>n</em> or <em>j</em> to go to the next uncovered block, <em>b</em>, <em>p</em> or <em>k</em> for the previous block.
</p>
<template id="filterTemplate">
<div class="quiet">
Filter:
<input type="search" id="fileSearch">
</div>
</template>
</div>
<div class='status-line high'></div>
<pre><table class="coverage">
<tr><td class="line-count quiet"><a name='L1'></a><a href='#L1'>1</a>
<a name='L2'></a><a href='#L2'>2</a>
<a name='L3'></a><a href='#L3'>3</a>
<a name='L4'></a><a href='#L4'>4</a>
<a name='L5'></a><a href='#L5'>5</a>
<a name='L6'></a><a href='#L6'>6</a>
<a name='L7'></a><a href='#L7'>7</a>
<a name='L8'></a><a href='#L8'>8</a>
<a name='L9'></a><a href='#L9'>9</a>
<a name='L10'></a><a href='#L10'>10</a>
<a name='L11'></a><a href='#L11'>11</a>
<a name='L12'></a><a href='#L12'>12</a>
<a name='L13'></a><a href='#L13'>13</a>
<a name='L14'></a><a href='#L14'>14</a>
<a name='L15'></a><a href='#L15'>15</a>
<a name='L16'></a><a href='#L16'>16</a>
<a name='L17'></a><a href='#L17'>17</a>
<a name='L18'></a><a href='#L18'>18</a>
<a name='L19'></a><a href='#L19'>19</a>
<a name='L20'></a><a href='#L20'>20</a>
<a name='L21'></a><a href='#L21'>21</a>
<a name='L22'></a><a href='#L22'>22</a>
<a name='L23'></a><a href='#L23'>23</a>
<a name='L24'></a><a href='#L24'>24</a>
<a name='L25'></a><a href='#L25'>25</a>
<a name='L26'></a><a href='#L26'>26</a>
<a name='L27'></a><a href='#L27'>27</a>
<a name='L28'></a><a href='#L28'>28</a>
<a name='L29'></a><a href='#L29'>29</a>
<a name='L30'></a><a href='#L30'>30</a>
<a name='L31'></a><a href='#L31'>31</a>
<a name='L32'></a><a href='#L32'>32</a>
<a name='L33'></a><a href='#L33'>33</a>
<a name='L34'></a><a href='#L34'>34</a>
<a name='L35'></a><a href='#L35'>35</a>
<a name='L36'></a><a href='#L36'>36</a>
<a name='L37'></a><a href='#L37'>37</a>
<a name='L38'></a><a href='#L38'>38</a>
<a name='L39'></a><a href='#L39'>39</a>
<a name='L40'></a><a href='#L40'>40</a>
<a name='L41'></a><a href='#L41'>41</a>
<a name='L42'></a><a href='#L42'>42</a>
<a name='L43'></a><a href='#L43'>43</a>
<a name='L44'></a><a href='#L44'>44</a>
<a name='L45'></a><a href='#L45'>45</a>
<a name='L46'></a><a href='#L46'>46</a>
<a name='L47'></a><a href='#L47'>47</a>
<a name='L48'></a><a href='#L48'>48</a>
<a name='L49'></a><a href='#L49'>49</a>
<a name='L50'></a><a href='#L50'>50</a>
<a name='L51'></a><a href='#L51'>51</a>
<a name='L52'></a><a href='#L52'>52</a>
<a name='L53'></a><a href='#L53'>53</a>
<a name='L54'></a><a href='#L54'>54</a>
<a name='L55'></a><a href='#L55'>55</a>
<a name='L56'></a><a href='#L56'>56</a>
<a name='L57'></a><a href='#L57'>57</a>
<a name='L58'></a><a href='#L58'>58</a>
<a name='L59'></a><a href='#L59'>59</a>
<a name='L60'></a><a href='#L60'>60</a>
<a name='L61'></a><a href='#L61'>61</a>
<a name='L62'></a><a href='#L62'>62</a>
<a name='L63'></a><a href='#L63'>63</a>
<a name='L64'></a><a href='#L64'>64</a>
<a name='L65'></a><a href='#L65'>65</a>
<a name='L66'></a><a href='#L66'>66</a>
<a name='L67'></a><a href='#L67'>67</a>
<a name='L68'></a><a href='#L68'>68</a>
<a name='L69'></a><a href='#L69'>69</a>
<a name='L70'></a><a href='#L70'>70</a>
<a name='L71'></a><a href='#L71'>71</a>
<a name='L72'></a><a href='#L72'>72</a>
<a name='L73'></a><a href='#L73'>73</a>
<a name='L74'></a><a href='#L74'>74</a>
<a name='L75'></a><a href='#L75'>75</a>
<a name='L76'></a><a href='#L76'>76</a>
<a name='L77'></a><a href='#L77'>77</a>
<a name='L78'></a><a href='#L78'>78</a>
<a name='L79'></a><a href='#L79'>79</a>
<a name='L80'></a><a href='#L80'>80</a>
<a name='L81'></a><a href='#L81'>81</a>
<a name='L82'></a><a href='#L82'>82</a>
<a name='L83'></a><a href='#L83'>83</a>
<a name='L84'></a><a href='#L84'>84</a>
<a name='L85'></a><a href='#L85'>85</a>
<a name='L86'></a><a href='#L86'>86</a></td><td class="line-coverage quiet"><span class="cline-any cline-yes">2x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">2x</span>
<span class="cline-any cline-yes">2x</span>
<span class="cline-any cline-yes">2x</span>
<span class="cline-any cline-yes">2x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">2x</span>
<span class="cline-any cline-yes">2x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">2x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">2x</span>
<span class="cline-any cline-yes">5x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">8x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">2x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">5x</span>
<span class="cline-any cline-yes">2x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">2x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">5x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">4x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">2x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">5x</span>
<span class="cline-any cline-yes">1x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">2x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">5x</span>
<span class="cline-any cline-yes">1x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">2x</span>
<span class="cline-any cline-yes">5x</span>
<span class="cline-any cline-yes">5x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span></td><td class="text"><pre class="prettyprint lang-js">import { Console } from "console";
import { Options } from "./options";
import { Chalk } from "chalk";
&nbsp;
// eslint-disable-next-line @typescript-eslint/no-explicit-any
type InternalLoggerFunc = (whereToLog: any, message: string) =&gt; void;
&nbsp;
export type LoggerFunc = (message: string) =&gt; void;
&nbsp;
export interface Logger {
log: LoggerFunc;
logInfo: LoggerFunc;
logWarning: LoggerFunc;
logError: LoggerFunc;
}
&nbsp;
enum LogLevel {
INFO = 1,
WARN = 2,
ERROR = 3,
}
&nbsp;
const stderrConsole = new Console(process.stderr);
const stdoutConsole = new Console(process.stdout);
&nbsp;
const doNothingLogger = (_message: string): void =&gt; {
/* Do nothing */
};
&nbsp;
const makeLoggerFunc = (options: Options): InternalLoggerFunc =&gt;
options.silent
? <span class="fstat-no" title="function not covered" ><span class="branch-0 cbranch-no" title="branch not covered" >(_</span>whereToLog: Console, _message: string) =&gt; {</span>
/* Do nothing */
}
: (whereToLog: Console, message: string) =&gt; whereToLog.log(message);
&nbsp;
const makeExternalLogger = (
loaderOptions: Options,
logger: InternalLoggerFunc
): LoggerFunc =&gt; (message: string) =&gt;
logger(
loaderOptions.logInfoToStdOut ? stdoutConsole : stderrConsole,
message
);
&nbsp;
const makeLogInfo = (
options: Options,
logger: InternalLoggerFunc,
green: Chalk
): LoggerFunc =&gt;
LogLevel[options.logLevel] &lt;= LogLevel.INFO
? (message: string) =&gt;
logger(
options.logInfoToStdOut ? stdoutConsole : stderrConsole,
green(message)
)
: doNothingLogger;
&nbsp;
const makeLogError = (
options: Options,
logger: InternalLoggerFunc,
red: Chalk
): LoggerFunc =&gt;
LogLevel[options.logLevel] &lt;= LogLevel.ERROR
? (message: string) =&gt; logger(stderrConsole, red(message))
: <span class="branch-1 cbranch-no" title="branch not covered" >doNothingLogger;</span>
&nbsp;
const makeLogWarning = (
options: Options,
logger: InternalLoggerFunc,
yellow: Chalk
): LoggerFunc =&gt;
LogLevel[options.logLevel] &lt;= LogLevel.WARN
? (message: string) =&gt; logger(stderrConsole, yellow(message))
: <span class="branch-1 cbranch-no" title="branch not covered" >doNothingLogger;</span>
&nbsp;
export function makeLogger(options: Options, colors: Chalk): Logger {
const logger = makeLoggerFunc(options);
return {
log: makeExternalLogger(options, logger),
logInfo: makeLogInfo(options, logger, colors.green),
logWarning: makeLogWarning(options, logger, colors.yellow),
logError: makeLogError(options, logger, colors.red),
};
}
&nbsp;</pre></td></tr></table></pre>
<div class='push'></div><!-- for sticky footer -->
</div><!-- /wrapper -->
<div class='footer quiet pad2 space-top1 center small'>
Code coverage generated by
<a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
at 2024-11-15T07:08:37.481Z
</div>
<script src="prettify.js"></script>
<script>
window.onload = function () {
prettyPrint();
};
</script>
<script src="sorter.js"></script>
<script src="block-navigation.js"></script>
</body>
</html>

View File

@@ -0,0 +1,340 @@
<!doctype html>
<html lang="en">
<head>
<title>Code coverage report for options.ts</title>
<meta charset="utf-8" />
<link rel="stylesheet" href="prettify.css" />
<link rel="stylesheet" href="base.css" />
<link rel="shortcut icon" type="image/x-icon" href="favicon.png" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<style type='text/css'>
.coverage-summary .sorter {
background-image: url(sort-arrow-sprite.png);
}
</style>
</head>
<body>
<div class='wrapper'>
<div class='pad1'>
<h1><a href="index.html">All files</a> options.ts</h1>
<div class='clearfix'>
<div class='fl pad1y space-right2'>
<span class="strong">93.33% </span>
<span class="quiet">Statements</span>
<span class='fraction'>14/15</span>
</div>
<div class='fl pad1y space-right2'>
<span class="strong">0% </span>
<span class="quiet">Branches</span>
<span class='fraction'>0/1</span>
</div>
<div class='fl pad1y space-right2'>
<span class="strong">100% </span>
<span class="quiet">Functions</span>
<span class='fraction'>3/3</span>
</div>
<div class='fl pad1y space-right2'>
<span class="strong">92.85% </span>
<span class="quiet">Lines</span>
<span class='fraction'>13/14</span>
</div>
</div>
<p class="quiet">
Press <em>n</em> or <em>j</em> to go to the next uncovered block, <em>b</em>, <em>p</em> or <em>k</em> for the previous block.
</p>
<template id="filterTemplate">
<div class="quiet">
Filter:
<input type="search" id="fileSearch">
</div>
</template>
</div>
<div class='status-line high'></div>
<pre><table class="coverage">
<tr><td class="line-count quiet"><a name='L1'></a><a href='#L1'>1</a>
<a name='L2'></a><a href='#L2'>2</a>
<a name='L3'></a><a href='#L3'>3</a>
<a name='L4'></a><a href='#L4'>4</a>
<a name='L5'></a><a href='#L5'>5</a>
<a name='L6'></a><a href='#L6'>6</a>
<a name='L7'></a><a href='#L7'>7</a>
<a name='L8'></a><a href='#L8'>8</a>
<a name='L9'></a><a href='#L9'>9</a>
<a name='L10'></a><a href='#L10'>10</a>
<a name='L11'></a><a href='#L11'>11</a>
<a name='L12'></a><a href='#L12'>12</a>
<a name='L13'></a><a href='#L13'>13</a>
<a name='L14'></a><a href='#L14'>14</a>
<a name='L15'></a><a href='#L15'>15</a>
<a name='L16'></a><a href='#L16'>16</a>
<a name='L17'></a><a href='#L17'>17</a>
<a name='L18'></a><a href='#L18'>18</a>
<a name='L19'></a><a href='#L19'>19</a>
<a name='L20'></a><a href='#L20'>20</a>
<a name='L21'></a><a href='#L21'>21</a>
<a name='L22'></a><a href='#L22'>22</a>
<a name='L23'></a><a href='#L23'>23</a>
<a name='L24'></a><a href='#L24'>24</a>
<a name='L25'></a><a href='#L25'>25</a>
<a name='L26'></a><a href='#L26'>26</a>
<a name='L27'></a><a href='#L27'>27</a>
<a name='L28'></a><a href='#L28'>28</a>
<a name='L29'></a><a href='#L29'>29</a>
<a name='L30'></a><a href='#L30'>30</a>
<a name='L31'></a><a href='#L31'>31</a>
<a name='L32'></a><a href='#L32'>32</a>
<a name='L33'></a><a href='#L33'>33</a>
<a name='L34'></a><a href='#L34'>34</a>
<a name='L35'></a><a href='#L35'>35</a>
<a name='L36'></a><a href='#L36'>36</a>
<a name='L37'></a><a href='#L37'>37</a>
<a name='L38'></a><a href='#L38'>38</a>
<a name='L39'></a><a href='#L39'>39</a>
<a name='L40'></a><a href='#L40'>40</a>
<a name='L41'></a><a href='#L41'>41</a>
<a name='L42'></a><a href='#L42'>42</a>
<a name='L43'></a><a href='#L43'>43</a>
<a name='L44'></a><a href='#L44'>44</a>
<a name='L45'></a><a href='#L45'>45</a>
<a name='L46'></a><a href='#L46'>46</a>
<a name='L47'></a><a href='#L47'>47</a>
<a name='L48'></a><a href='#L48'>48</a>
<a name='L49'></a><a href='#L49'>49</a>
<a name='L50'></a><a href='#L50'>50</a>
<a name='L51'></a><a href='#L51'>51</a>
<a name='L52'></a><a href='#L52'>52</a>
<a name='L53'></a><a href='#L53'>53</a>
<a name='L54'></a><a href='#L54'>54</a>
<a name='L55'></a><a href='#L55'>55</a>
<a name='L56'></a><a href='#L56'>56</a>
<a name='L57'></a><a href='#L57'>57</a>
<a name='L58'></a><a href='#L58'>58</a>
<a name='L59'></a><a href='#L59'>59</a>
<a name='L60'></a><a href='#L60'>60</a>
<a name='L61'></a><a href='#L61'>61</a>
<a name='L62'></a><a href='#L62'>62</a>
<a name='L63'></a><a href='#L63'>63</a>
<a name='L64'></a><a href='#L64'>64</a>
<a name='L65'></a><a href='#L65'>65</a>
<a name='L66'></a><a href='#L66'>66</a>
<a name='L67'></a><a href='#L67'>67</a>
<a name='L68'></a><a href='#L68'>68</a>
<a name='L69'></a><a href='#L69'>69</a>
<a name='L70'></a><a href='#L70'>70</a>
<a name='L71'></a><a href='#L71'>71</a>
<a name='L72'></a><a href='#L72'>72</a>
<a name='L73'></a><a href='#L73'>73</a>
<a name='L74'></a><a href='#L74'>74</a>
<a name='L75'></a><a href='#L75'>75</a>
<a name='L76'></a><a href='#L76'>76</a>
<a name='L77'></a><a href='#L77'>77</a>
<a name='L78'></a><a href='#L78'>78</a>
<a name='L79'></a><a href='#L79'>79</a>
<a name='L80'></a><a href='#L80'>80</a>
<a name='L81'></a><a href='#L81'>81</a>
<a name='L82'></a><a href='#L82'>82</a>
<a name='L83'></a><a href='#L83'>83</a>
<a name='L84'></a><a href='#L84'>84</a>
<a name='L85'></a><a href='#L85'>85</a>
<a name='L86'></a><a href='#L86'>86</a></td><td class="line-coverage quiet"><span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">1x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">1x</span>
<span class="cline-any cline-yes">3x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">3x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">3x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">3x</span>
<span class="cline-any cline-yes">3x</span>
<span class="cline-any cline-yes">10x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">10x</span>
<span class="cline-any cline-yes">10x</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">3x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">3x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">3x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span></td><td class="text"><pre class="prettyprint lang-js">export type LogLevel = "INFO" | "WARN" | "ERROR";
&nbsp;
export interface Options {
readonly configFile: string;
readonly extensions: ReadonlyArray&lt;string&gt;;
readonly baseUrl: string | undefined;
readonly silent: boolean;
readonly logLevel: LogLevel;
readonly logInfoToStdOut: boolean;
readonly context: string | undefined;
readonly colors: boolean;
readonly mainFields: (string | string[])[];
readonly references: string[] | undefined;
}
&nbsp;
type ValidOptions = keyof Options;
const validOptions: ReadonlyArray&lt;ValidOptions&gt; = [
"configFile",
"extensions",
"baseUrl",
"silent",
"logLevel",
"logInfoToStdOut",
"context",
"mainFields",
"references",
];
&nbsp;
/**
* Takes raw options from the webpack config,
* validates them and adds defaults for missing options
*/
export function getOptions(rawOptions: {}): Options {
validateOptions(rawOptions);
&nbsp;
const options = makeOptions(rawOptions);
&nbsp;
return options;
}
&nbsp;
/**
* Validate the supplied loader options.
* At present this validates the option names only; in future we may look at validating the values too
*
* @param rawOptions
*/
function validateOptions(rawOptions: {}): void {
const loaderOptionKeys = Object.keys(rawOptions);
for (let i = 0; i &lt; loaderOptionKeys.length; i++) {
const option = loaderOptionKeys[i];
const isUnexpectedOption =
(validOptions as ReadonlyArray&lt;string&gt;).indexOf(option) === -1;
<span class="missing-if-branch" title="if path not taken" >I</span>if (isUnexpectedOption) {
<span class="cstat-no" title="statement not covered" > throw new Error(`tsconfig-paths-webpack-plugin was supplied with an unexpected loader option: ${option}</span>
Please take a look at the options you are supplying; the following are valid options:
${validOptions.join(" / ")}
`);
}
}
}
&nbsp;
function makeOptions(rawOptions: Partial&lt;Options&gt;): Options {
const options: Options = {
...({
configFile: "tsconfig.json",
extensions: [".ts", ".tsx"],
baseUrl: undefined,
silent: false,
logLevel: "WARN",
logInfoToStdOut: false,
context: undefined,
colors: true,
mainFields: ["main"],
references: undefined,
} as Options),
...rawOptions,
};
&nbsp;
const options2: Options = {
...options,
logLevel: options.logLevel.toUpperCase() as LogLevel,
};
&nbsp;
return options2;
}
&nbsp;</pre></td></tr></table></pre>
<div class='push'></div><!-- for sticky footer -->
</div><!-- /wrapper -->
<div class='footer quiet pad2 space-top1 center small'>
Code coverage generated by
<a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
at 2024-11-15T07:08:37.481Z
</div>
<script src="prettify.js"></script>
<script>
window.onload = function () {
prettyPrint();
};
</script>
<script src="sorter.js"></script>
<script src="block-navigation.js"></script>
</body>
</html>

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1 @@
.pln{color:#000}@media screen{.str{color:#080}.kwd{color:#008}.com{color:#800}.typ{color:#606}.lit{color:#066}.pun,.opn,.clo{color:#660}.tag{color:#008}.atn{color:#606}.atv{color:#080}.dec,.var{color:#606}.fun{color:red}}@media print,projection{.str{color:#060}.kwd{color:#006;font-weight:bold}.com{color:#600;font-style:italic}.typ{color:#404;font-weight:bold}.lit{color:#044}.pun,.opn,.clo{color:#440}.tag{color:#006;font-weight:bold}.atn{color:#404}.atv{color:#060}}pre.prettyprint{padding:2px;border:1px solid #888}ol.linenums{margin-top:0;margin-bottom:0}li.L0,li.L1,li.L2,li.L3,li.L5,li.L6,li.L7,li.L8{list-style-type:none}li.L1,li.L3,li.L5,li.L7,li.L9{background:#eee}

File diff suppressed because one or more lines are too long

Binary file not shown.

After

Width:  |  Height:  |  Size: 138 B

View File

@@ -0,0 +1,196 @@
/* eslint-disable */
var addSorting = (function() {
'use strict';
var cols,
currentSort = {
index: 0,
desc: false
};
// returns the summary table element
function getTable() {
return document.querySelector('.coverage-summary');
}
// returns the thead element of the summary table
function getTableHeader() {
return getTable().querySelector('thead tr');
}
// returns the tbody element of the summary table
function getTableBody() {
return getTable().querySelector('tbody');
}
// returns the th element for nth column
function getNthColumn(n) {
return getTableHeader().querySelectorAll('th')[n];
}
function onFilterInput() {
const searchValue = document.getElementById('fileSearch').value;
const rows = document.getElementsByTagName('tbody')[0].children;
for (let i = 0; i < rows.length; i++) {
const row = rows[i];
if (
row.textContent
.toLowerCase()
.includes(searchValue.toLowerCase())
) {
row.style.display = '';
} else {
row.style.display = 'none';
}
}
}
// loads the search box
function addSearchBox() {
var template = document.getElementById('filterTemplate');
var templateClone = template.content.cloneNode(true);
templateClone.getElementById('fileSearch').oninput = onFilterInput;
template.parentElement.appendChild(templateClone);
}
// loads all columns
function loadColumns() {
var colNodes = getTableHeader().querySelectorAll('th'),
colNode,
cols = [],
col,
i;
for (i = 0; i < colNodes.length; i += 1) {
colNode = colNodes[i];
col = {
key: colNode.getAttribute('data-col'),
sortable: !colNode.getAttribute('data-nosort'),
type: colNode.getAttribute('data-type') || 'string'
};
cols.push(col);
if (col.sortable) {
col.defaultDescSort = col.type === 'number';
colNode.innerHTML =
colNode.innerHTML + '<span class="sorter"></span>';
}
}
return cols;
}
// attaches a data attribute to every tr element with an object
// of data values keyed by column name
function loadRowData(tableRow) {
var tableCols = tableRow.querySelectorAll('td'),
colNode,
col,
data = {},
i,
val;
for (i = 0; i < tableCols.length; i += 1) {
colNode = tableCols[i];
col = cols[i];
val = colNode.getAttribute('data-value');
if (col.type === 'number') {
val = Number(val);
}
data[col.key] = val;
}
return data;
}
// loads all row data
function loadData() {
var rows = getTableBody().querySelectorAll('tr'),
i;
for (i = 0; i < rows.length; i += 1) {
rows[i].data = loadRowData(rows[i]);
}
}
// sorts the table using the data for the ith column
function sortByIndex(index, desc) {
var key = cols[index].key,
sorter = function(a, b) {
a = a.data[key];
b = b.data[key];
return a < b ? -1 : a > b ? 1 : 0;
},
finalSorter = sorter,
tableBody = document.querySelector('.coverage-summary tbody'),
rowNodes = tableBody.querySelectorAll('tr'),
rows = [],
i;
if (desc) {
finalSorter = function(a, b) {
return -1 * sorter(a, b);
};
}
for (i = 0; i < rowNodes.length; i += 1) {
rows.push(rowNodes[i]);
tableBody.removeChild(rowNodes[i]);
}
rows.sort(finalSorter);
for (i = 0; i < rows.length; i += 1) {
tableBody.appendChild(rows[i]);
}
}
// removes sort indicators for current column being sorted
function removeSortIndicators() {
var col = getNthColumn(currentSort.index),
cls = col.className;
cls = cls.replace(/ sorted$/, '').replace(/ sorted-desc$/, '');
col.className = cls;
}
// adds sort indicators for current column being sorted
function addSortIndicators() {
getNthColumn(currentSort.index).className += currentSort.desc
? ' sorted-desc'
: ' sorted';
}
// adds event listeners for all sorter widgets
function enableUI() {
var i,
el,
ithSorter = function ithSorter(i) {
var col = cols[i];
return function() {
var desc = col.defaultDescSort;
if (currentSort.index === i) {
desc = !currentSort.desc;
}
sortByIndex(i, desc);
removeSortIndicators();
currentSort.index = i;
currentSort.desc = desc;
addSortIndicators();
};
};
for (i = 0; i < cols.length; i += 1) {
if (cols[i].sortable) {
// add the click event handler on the th so users
// dont have to click on those tiny arrows
el = getNthColumn(i).querySelector('.sorter').parentElement;
if (el.addEventListener) {
el.addEventListener('click', ithSorter(i));
} else {
el.attachEvent('onclick', ithSorter(i));
}
}
}
}
// adds sorting functionality to the UI
return function() {
if (!getTable()) {
return;
}
cols = loadColumns();
loadData();
addSearchBox();
addSortIndicators();
enableUI();
};
})();
window.addEventListener('load', addSorting);

View File

@@ -0,0 +1,370 @@
TN:
SF:src/index.ts
FN:1,(anonymous_0)
FNF:1
FNH:0
FNDA:0,(anonymous_0)
DA:1,0
DA:2,0
DA:3,0
DA:9,0
DA:10,0
DA:11,0
DA:12,0
LF:7
LH:0
BRF:0
BRH:0
end_of_record
TN:
SF:src/logger.ts
FN:17,(anonymous_0)
FN:26,(anonymous_1)
FN:30,(anonymous_2)
FN:32,(anonymous_3)
FN:35,(anonymous_4)
FN:37,(anonymous_5)
FN:40,(anonymous_6)
FN:46,(anonymous_7)
FN:52,(anonymous_8)
FN:59,(anonymous_9)
FN:65,(anonymous_10)
FN:68,(anonymous_11)
FN:74,(anonymous_12)
FN:77,makeLogger
FNF:14
FNH:13
FNDA:2,(anonymous_0)
FNDA:1,(anonymous_1)
FNDA:5,(anonymous_2)
FNDA:0,(anonymous_3)
FNDA:8,(anonymous_4)
FNDA:5,(anonymous_5)
FNDA:2,(anonymous_6)
FNDA:5,(anonymous_7)
FNDA:4,(anonymous_8)
FNDA:5,(anonymous_9)
FNDA:1,(anonymous_10)
FNDA:5,(anonymous_11)
FNDA:1,(anonymous_12)
FNDA:5,makeLogger
DA:1,2
DA:17,2
DA:18,2
DA:19,2
DA:20,2
DA:23,2
DA:24,2
DA:26,2
DA:30,2
DA:31,5
DA:35,8
DA:37,2
DA:40,5
DA:41,2
DA:46,2
DA:51,5
DA:53,4
DA:59,2
DA:64,5
DA:65,1
DA:68,2
DA:73,5
DA:74,1
DA:77,2
DA:78,5
DA:79,5
LF:26
LH:26
BRDA:17,0,0,2
BRDA:17,0,1,2
BRDA:31,1,0,0
BRDA:31,1,1,5
BRDA:42,2,0,1
BRDA:42,2,1,1
BRDA:51,3,0,4
BRDA:51,3,1,1
BRDA:54,4,0,1
BRDA:54,4,1,3
BRDA:64,5,0,5
BRDA:64,5,1,0
BRDA:73,6,0,5
BRDA:73,6,1,0
BRF:14
BRH:11
end_of_record
TN:
SF:src/options.ts
FN:33,getOptions
FN:47,validateOptions
FN:62,makeOptions
FNF:3
FNH:3
FNDA:3,getOptions
FNDA:3,validateOptions
FNDA:3,makeOptions
DA:17,1
DA:33,1
DA:34,3
DA:36,3
DA:38,3
DA:48,3
DA:49,3
DA:50,10
DA:52,10
DA:53,10
DA:54,0
DA:63,3
DA:79,3
DA:84,3
LF:14
LH:13
BRDA:53,0,0,0
BRF:1
BRH:0
end_of_record
TN:
SF:src/plugin.ts
FN:124,(anonymous_2)
FN:138,TsconfigPathsPlugin
FN:167,(anonymous_4)
FN:185,(anonymous_5)
FN:237,loadConfig
FN:252,createPluginCallback
FN:265,(anonymous_8)
FN:292,(anonymous_9)
FN:314,(anonymous_10)
FN:340,(anonymous_11)
FN:360,createPluginLegacy
FN:369,(anonymous_13)
FN:385,(anonymous_14)
FN:409,(anonymous_15)
FN:428,readJson
FN:437,(anonymous_17)
FN:455,createReadJsonAsync
FN:459,(anonymous_19)
FN:460,(anonymous_20)
FN:471,createFileExistAsync
FN:474,(anonymous_22)
FN:478,(anonymous_23)
FNF:22
FNH:17
FNDA:1,(anonymous_2)
FNDA:3,TsconfigPathsPlugin
FNDA:1,(anonymous_4)
FNDA:6,(anonymous_5)
FNDA:4,loadConfig
FNDA:6,createPluginCallback
FNDA:39,(anonymous_8)
FNDA:7,(anonymous_9)
FNDA:39,(anonymous_10)
FNDA:18,(anonymous_11)
FNDA:0,createPluginLegacy
FNDA:0,(anonymous_13)
FNDA:0,(anonymous_14)
FNDA:0,(anonymous_15)
FNDA:36,readJson
FNDA:0,(anonymous_17)
FNDA:6,createReadJsonAsync
FNDA:36,(anonymous_19)
FNDA:36,(anonymous_20)
FNDA:6,createFileExistAsync
FNDA:171,(anonymous_22)
FNDA:171,(anonymous_23)
DA:1,1
DA:2,1
DA:3,1
DA:4,1
DA:5,1
DA:122,1
DA:124,1
DA:127,3
DA:128,3
DA:138,3
DA:139,3
DA:141,3
DA:142,3
DA:146,3
DA:151,3
DA:152,3
DA:154,3
DA:155,3
DA:156,3
DA:157,3
DA:160,3
DA:166,3
DA:167,1
DA:168,1
DA:169,1
DA:170,1
DA:171,2
DA:172,1
DA:179,1
DA:185,1
DA:186,6
DA:187,0
DA:190,0
DA:196,6
DA:197,0
DA:202,0
DA:206,6
DA:207,6
DA:220,0
DA:222,0
DA:223,0
DA:235,1
DA:241,4
DA:242,4
DA:243,0
DA:245,4
DA:249,4
DA:263,6
DA:264,6
DA:265,6
DA:270,39
DA:272,39
DA:277,0
DA:283,39
DA:284,39
DA:288,27
DA:289,6
DA:291,21
DA:293,7
DA:294,7
DA:301,21
DA:302,6
DA:307,39
DA:309,39
DA:315,39
DA:316,0
DA:319,39
DA:320,21
DA:323,18
DA:332,18
DA:334,18
DA:343,18
DA:344,0
DA:348,18
DA:349,0
DA:352,18
DA:367,0
DA:368,0
DA:369,0
DA:370,0
DA:372,0
DA:377,0
DA:380,0
DA:386,0
DA:387,0
DA:390,0
DA:391,0
DA:394,0
DA:403,0
DA:405,0
DA:415,0
DA:416,0
DA:420,0
DA:433,36
DA:434,36
DA:437,0
DA:438,0
DA:439,0
DA:444,0
DA:446,0
DA:448,0
DA:451,0
DA:459,6
DA:460,36
DA:462,36
DA:463,27
DA:464,27
DA:466,9
DA:474,6
DA:478,171
DA:480,171
DA:481,138
DA:482,138
DA:484,33
LF:114
LH:78
BRDA:138,0,0,0
BRDA:148,1,0,3
BRDA:148,1,1,0
BRDA:151,2,0,3
BRDA:151,2,1,3
BRDA:152,3,0,3
BRDA:152,3,1,0
BRDA:155,4,0,3
BRDA:156,5,0,3
BRDA:156,5,1,3
BRDA:157,6,0,0
BRDA:157,6,1,3
BRDA:166,7,0,1
BRDA:168,8,0,1
BRDA:170,9,0,1
BRDA:186,10,0,0
BRDA:196,11,0,0
BRDA:206,12,0,6
BRDA:206,12,1,0
BRDA:206,13,0,6
BRDA:206,13,1,6
BRDA:220,14,0,0
BRDA:242,15,0,0
BRDA:242,15,1,4
BRDA:272,16,0,0
BRDA:273,17,0,39
BRDA:273,17,1,39
BRDA:273,17,2,39
BRDA:274,18,0,0
BRDA:274,18,1,39
BRDA:274,19,0,39
BRDA:274,19,1,39
BRDA:274,20,0,0
BRDA:274,20,1,39
BRDA:274,21,0,39
BRDA:274,21,1,39
BRDA:275,22,0,0
BRDA:275,22,1,39
BRDA:275,23,0,39
BRDA:275,23,1,39
BRDA:275,24,0,0
BRDA:275,24,1,39
BRDA:275,25,0,39
BRDA:275,25,1,39
BRDA:284,26,0,27
BRDA:285,27,0,39
BRDA:285,27,1,39
BRDA:288,28,0,6
BRDA:288,28,1,21
BRDA:293,29,0,7
BRDA:293,29,1,0
BRDA:295,30,0,7
BRDA:295,30,1,7
BRDA:295,30,2,6
BRDA:301,31,0,6
BRDA:307,32,0,39
BRDA:307,32,1,27
BRDA:315,33,0,0
BRDA:319,34,0,21
BRDA:343,35,0,0
BRDA:348,36,0,0
BRDA:372,37,0,0
BRDA:373,38,0,0
BRDA:373,38,1,0
BRDA:373,38,2,0
BRDA:386,39,0,0
BRDA:390,40,0,0
BRDA:415,41,0,0
BRDA:433,42,0,36
BRDA:433,43,0,36
BRDA:433,43,1,36
BRDA:438,44,0,0
BRDA:462,45,0,27
BRDA:462,46,0,36
BRDA:462,46,1,9
BRDA:480,47,0,138
BRDA:484,48,0,33
BRDA:484,48,1,0
BRF:78
BRH:51
end_of_record

View File

@@ -0,0 +1,25 @@
const fs = require("fs");
const webpack = require("webpack");
const config = require("./webpack.config");
const compiler = webpack(config);
compiler.inputFileSystem = fs;
compiler.run(function (error, stats) {
if (error) {
console.error(error);
return process.exit(1);
}
if (stats.compilation.errors.length) {
stats.compilation.errors.forEach((compilationError) => {
console.error(compilationError);
});
return process.exit(1);
}
console.log("Successfully compiled");
});

View File

@@ -0,0 +1,37 @@
const path = require("path");
const TsconfigPathsPlugin = require("../");
module.exports = {
mode: "development",
context: path.resolve(__dirname, "src"),
entry: "./index",
output: {
path: path.join(__dirname, "temp"),
filename: "bundle.js",
},
module: {
rules: [
{
test: /\\.tsx?$/,
exclude: /^node_modules/,
loader: "ts-loader",
options: {
configFile: "./example/tsconfig.json",
},
},
],
},
resolve: {
extensions: [".ts", ".tsx", ".js"],
plugins: [
new TsconfigPathsPlugin({
configFile: "./tsconfig.json",
logLevel: "info",
extensions: [".ts", ".tsx"],
mainFields: ["browser", "main"],
references: ["../example/tsconfig.json"]
// baseUrl: "/foo"
}),
],
},
};

View File

@@ -0,0 +1,10 @@
/** @type {import('ts-jest/dist/types').InitialOptionsTsJest} */
module.exports = {
preset: "ts-jest",
testEnvironment: "node",
testMatch: ["<rootDir>/src/**/*.test.{ts,tsx}"],
collectCoverage: false,
coverageDirectory: "<rootDir>/coverage/",
collectCoverageFrom: ["<rootDir>/src/**/*.{ts,tsx}"],
coveragePathIgnorePatterns: ["/__tests__/"],
};

View File

@@ -0,0 +1 @@
export {};

View File

@@ -0,0 +1,55 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var logger_1 = require("../logger");
var chalk = require("chalk");
var jest_mock_process_1 = require("jest-mock-process");
// jest.mock("Console", () => {
// return jest.fn();
// });
describe("Logger", function () {
var mockStdout = (0, jest_mock_process_1.mockProcessStdout)();
var mockStderr = (0, jest_mock_process_1.mockProcessStderr)();
beforeEach(function () {
jest.clearAllMocks();
});
test("Can create a logger instance to process.stdout", function () {
var result = (0, logger_1.makeLogger)({
baseUrl: undefined,
colors: false,
configFile: "",
context: undefined,
extensions: [],
logInfoToStdOut: true,
logLevel: "INFO",
mainFields: [],
silent: false,
references: undefined,
}, new chalk.Instance());
expect(result).toBeDefined();
result.logInfo("Test logInfo");
result.logWarning("Test logWarning");
result.logError("Test logError");
result.log("Test external logger");
expect(mockStdout).toHaveBeenCalledTimes(2);
expect(mockStderr).toHaveBeenCalledTimes(2);
});
test("Can create a logger instance to process.stderr", function () {
var result = (0, logger_1.makeLogger)({
baseUrl: undefined,
colors: false,
configFile: "",
context: undefined,
extensions: [],
logInfoToStdOut: false,
logLevel: "INFO",
mainFields: [],
silent: false,
references: undefined,
}, new chalk.Instance());
expect(result).toBeDefined();
result.log("Test external logger");
expect(mockStderr).toHaveBeenCalledTimes(1);
expect(mockStdout).not.toHaveBeenCalled();
});
});
//# sourceMappingURL=logger.test.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"logger.test.js","sourceRoot":"","sources":["../../src/__tests__/logger.test.ts"],"names":[],"mappings":";;AAAA,oCAAuC;AACvC,6BAA+B;AAC/B,uDAAyE;AAEzE,+BAA+B;AAC/B,sBAAsB;AACtB,MAAM;AAEN,QAAQ,CAAC,QAAQ,EAAE;IACjB,IAAM,UAAU,GAAG,IAAA,qCAAiB,GAAE,CAAC;IACvC,IAAM,UAAU,GAAG,IAAA,qCAAiB,GAAE,CAAC;IAEvC,UAAU,CAAC;QACT,IAAI,CAAC,aAAa,EAAE,CAAC;IACvB,CAAC,CAAC,CAAC;IAEH,IAAI,CAAC,gDAAgD,EAAE;QACrD,IAAM,MAAM,GAAG,IAAA,mBAAU,EACvB;YACE,OAAO,EAAE,SAAS;YAClB,MAAM,EAAE,KAAK;YACb,UAAU,EAAE,EAAE;YACd,OAAO,EAAE,SAAS;YAClB,UAAU,EAAE,EAAE;YACd,eAAe,EAAE,IAAI;YACrB,QAAQ,EAAE,MAAM;YAChB,UAAU,EAAE,EAAE;YACd,MAAM,EAAE,KAAK;YACb,UAAU,EAAE,SAAS;SACtB,EACD,IAAI,KAAK,CAAC,QAAQ,EAAE,CACrB,CAAC;QACF,MAAM,CAAC,MAAM,CAAC,CAAC,WAAW,EAAE,CAAC;QAE7B,MAAM,CAAC,OAAO,CAAC,cAAc,CAAC,CAAC;QAC/B,MAAM,CAAC,UAAU,CAAC,iBAAiB,CAAC,CAAC;QACrC,MAAM,CAAC,QAAQ,CAAC,eAAe,CAAC,CAAC;QACjC,MAAM,CAAC,GAAG,CAAC,sBAAsB,CAAC,CAAC;QAEnC,MAAM,CAAC,UAAU,CAAC,CAAC,qBAAqB,CAAC,CAAC,CAAC,CAAC;QAC5C,MAAM,CAAC,UAAU,CAAC,CAAC,qBAAqB,CAAC,CAAC,CAAC,CAAC;IAC9C,CAAC,CAAC,CAAC;IAEH,IAAI,CAAC,gDAAgD,EAAE;QACrD,IAAM,MAAM,GAAG,IAAA,mBAAU,EACvB;YACE,OAAO,EAAE,SAAS;YAClB,MAAM,EAAE,KAAK;YACb,UAAU,EAAE,EAAE;YACd,OAAO,EAAE,SAAS;YAClB,UAAU,EAAE,EAAE;YACd,eAAe,EAAE,KAAK;YACtB,QAAQ,EAAE,MAAM;YAChB,UAAU,EAAE,EAAE;YACd,MAAM,EAAE,KAAK;YACb,UAAU,EAAE,SAAS;SACtB,EACD,IAAI,KAAK,CAAC,QAAQ,EAAE,CACrB,CAAC;QACF,MAAM,CAAC,MAAM,CAAC,CAAC,WAAW,EAAE,CAAC;QAE7B,MAAM,CAAC,GAAG,CAAC,sBAAsB,CAAC,CAAC;QAEnC,MAAM,CAAC,UAAU,CAAC,CAAC,qBAAqB,CAAC,CAAC,CAAC,CAAC;QAC5C,MAAM,CAAC,UAAU,CAAC,CAAC,GAAG,CAAC,gBAAgB,EAAE,CAAC;IAC5C,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}

View File

@@ -0,0 +1 @@
export {};

View File

@@ -0,0 +1,148 @@
"use strict";
var __assign = (this && this.__assign) || function () {
__assign = Object.assign || function(t) {
for (var s, i = 1, n = arguments.length; i < n; i++) {
s = arguments[i];
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
t[p] = s[p];
}
return t;
};
return __assign.apply(this, arguments);
};
Object.defineProperty(exports, "__esModule", { value: true });
var webpack = require("webpack");
var path = require("path");
var plugin_1 = require("../plugin");
describe("TsconfigPathsPlugin", function () {
var SETTINGS = {
mode: "development",
context: path.resolve(__dirname, "src"),
entry: "".concat(__dirname, "/../../examples/example/src/index.ts"),
output: {
path: path.join(__dirname, "../../temp"),
filename: "bundle.js",
},
module: {
rules: [
{
test: /\\.tsx?$/,
exclude: /^node_modules/,
loader: "ts-loader",
options: {
configFile: "./example/tsconfig.json",
},
},
],
},
resolve: {
extensions: [".ts", ".tsx", ".js"],
},
};
it("Can initialize the plugin", function (done) {
var testPlugin = new plugin_1.TsconfigPathsPlugin({
configFile: "".concat(__dirname, "/../../examples/example/tsconfig.json"),
logLevel: "INFO",
extensions: [".ts", ".tsx"],
mainFields: ["browser", "main"],
});
expect(testPlugin).toBeInstanceOf(plugin_1.TsconfigPathsPlugin);
var testSettings = __assign(__assign({}, SETTINGS), { resolve: {
extensions: [".ts", ".tsx", ".js"],
plugins: [testPlugin],
} });
var compiler = webpack(testSettings);
compiler.run(function (err, stats) {
if (err) {
done(err);
return;
}
expect(stats).toBeDefined();
var details = stats === null || stats === void 0 ? void 0 : stats.toJson();
expect(details === null || details === void 0 ? void 0 : details.errorsCount).toEqual(0);
// TODO There should probably be a test that verifies the stats match what is expected
done();
});
});
it("Test to ensure Apply exists and is working", function (done) {
var _a, _b, _c;
var webpackSettings = {
entry: "".concat(__dirname, "/../../examples/example/src/index.ts"),
target: "web",
output: {
path: path.join(__dirname, "../../temp"),
filename: "[name].js",
},
mode: "development",
resolve: {
extensions: [
".ts",
".tsx",
".js",
".jsx",
"ttf",
"eot",
"otf",
"svg",
"png",
"woff",
"woff2",
],
plugins: [
new plugin_1.TsconfigPathsPlugin({
configFile: "".concat(__dirname, "/../../examples/example/tsconfig.json"),
}),
],
},
module: {
rules: [],
},
};
// Build compiler
var compiler = webpack(webpackSettings);
var pluginInstance = (_c = (_b = (_a = compiler === null || compiler === void 0 ? void 0 : compiler.options) === null || _a === void 0 ? void 0 : _a.resolve) === null || _b === void 0 ? void 0 : _b.plugins) === null || _c === void 0 ? void 0 : _c.find(function (plugin) { return plugin instanceof plugin_1.TsconfigPathsPlugin; });
if (!pluginInstance) {
return done("TsconfigPathsPlugin not loaded in webpack settings");
}
expect(pluginInstance instanceof plugin_1.TsconfigPathsPlugin).toBeTruthy();
expect(pluginInstance.apply).toBeDefined();
// Run compiler
compiler.run(function (err, stats) {
if (err) {
done(err);
return;
}
expect(stats).toBeDefined();
var details = stats === null || stats === void 0 ? void 0 : stats.toJson();
expect(details === null || details === void 0 ? void 0 : details.errorsCount).toEqual(0);
done();
});
});
it("Resolves project references", function (done) {
var testPlugin = new plugin_1.TsconfigPathsPlugin({
configFile: "".concat(__dirname, "/../../examples/referenceExample/tsconfig.json"),
logLevel: "INFO",
extensions: [".ts", ".tsx"],
mainFields: ["browser", "main"],
references: ["".concat(__dirname, "/../../examples/example/tsconfig.json")],
});
expect(testPlugin).toBeInstanceOf(plugin_1.TsconfigPathsPlugin);
var testSettings = __assign(__assign({}, SETTINGS), { resolve: {
extensions: [".ts", ".tsx", ".js"],
plugins: [testPlugin],
} });
var compiler = webpack(testSettings);
compiler.run(function (err, stats) {
if (err) {
done(err);
return;
}
expect(stats).toBeDefined();
var details = stats === null || stats === void 0 ? void 0 : stats.toJson();
expect(details === null || details === void 0 ? void 0 : details.errorsCount).toEqual(0);
// TODO There should probably be a test that verifies the stats match what is expected
done();
});
});
});
//# sourceMappingURL=plugins.test.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"plugins.test.js","sourceRoot":"","sources":["../../src/__tests__/plugins.test.ts"],"names":[],"mappings":";;;;;;;;;;;;;AAAA,iCAAmC;AAEnC,IAAM,IAAI,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;AAC7B,oCAAgD;AAEhD,QAAQ,CAAC,qBAAqB,EAAE;IAC9B,IAAM,QAAQ,GAAkB;QAC9B,IAAI,EAAE,aAAa;QACnB,OAAO,EAAE,IAAI,CAAC,OAAO,CAAC,SAAS,EAAE,KAAK,CAAC;QACvC,KAAK,EAAE,UAAG,SAAS,yCAAsC;QACzD,MAAM,EAAE;YACN,IAAI,EAAE,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE,YAAY,CAAC;YACxC,QAAQ,EAAE,WAAW;SACtB;QACD,MAAM,EAAE;YACN,KAAK,EAAE;gBACL;oBACE,IAAI,EAAE,UAAU;oBAChB,OAAO,EAAE,eAAe;oBACxB,MAAM,EAAE,WAAW;oBACnB,OAAO,EAAE;wBACP,UAAU,EAAE,yBAAyB;qBACtC;iBACF;aACF;SACF;QACD,OAAO,EAAE;YACP,UAAU,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,CAAC;SACnC;KACF,CAAC;IAEF,EAAE,CAAC,2BAA2B,EAAE,UAAC,IAAI;QACnC,IAAM,UAAU,GAAG,IAAI,4BAAmB,CAAC;YACzC,UAAU,EAAE,UAAG,SAAS,0CAAuC;YAC/D,QAAQ,EAAE,MAAM;YAChB,UAAU,EAAE,CAAC,KAAK,EAAE,MAAM,CAAC;YAC3B,UAAU,EAAE,CAAC,SAAS,EAAE,MAAM,CAAC;SAChC,CAAC,CAAC;QACH,MAAM,CAAC,UAAU,CAAC,CAAC,cAAc,CAAC,4BAAmB,CAAC,CAAC;QAEvD,IAAM,YAAY,yBACb,QAAQ,KACX,OAAO,EAAE;gBACP,UAAU,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,CAAC;gBAClC,OAAO,EAAE,CAAC,UAAU,CAAC;aACtB,GACF,CAAC;QAEF,IAAM,QAAQ,GAAG,OAAO,CAAC,YAAY,CAAC,CAAC;QAEvC,QAAQ,CAAC,GAAG,CAAC,UAAC,GAAG,EAAE,KAAK;YACtB,IAAI,GAAG,EAAE;gBACP,IAAI,CAAC,GAAG,CAAC,CAAC;gBACV,OAAO;aACR;YACD,MAAM,CAAC,KAAK,CAAC,CAAC,WAAW,EAAE,CAAC;YAC5B,IAAM,OAAO,GAAG,KAAK,aAAL,KAAK,uBAAL,KAAK,CAAE,MAAM,EAAE,CAAC;YAChC,MAAM,CAAC,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,WAAW,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;YACxC,sFAAsF;YACtF,IAAI,EAAE,CAAC;QACT,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,4CAA4C,EAAE,UAAC,IAAI;;QACpD,IAAM,eAAe,GAAkB;YACrC,KAAK,EAAE,UAAG,SAAS,yCAAsC;YACzD,MAAM,EAAE,KAAK;YACb,MAAM,EAAE;gBACN,IAAI,EAAE,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE,YAAY,CAAC;gBACxC,QAAQ,EAAE,WAAW;aACtB;YACD,IAAI,EAAE,aAAa;YACnB,OAAO,EAAE;gBACP,UAAU,EAAE;oBACV,KAAK;oBACL,MAAM;oBACN,KAAK;oBACL,MAAM;oBACN,KAAK;oBACL,KAAK;oBACL,KAAK;oBACL,KAAK;oBACL,KAAK;oBACL,MAAM;oBACN,OAAO;iBACR;gBACD,OAAO,EAAE;oBACP,IAAI,4BAAmB,CAAC;wBACtB,UAAU,EAAE,UAAG,SAAS,0CAAuC;qBAChE,CAAC;iBACH;aACF;YACD,MAAM,EAAE;gBACN,KAAK,EAAE,EAAE;aACV;SACF,CAAC;QACF,iBAAiB;QACjB,IAAM,QAAQ,GAAG,OAAO,CAAC,eAAe,CAAC,CAAC;QAC1C,IAAM,cAAc,GAAG,MAAA,MAAA,MAAA,QAAQ,aAAR,QAAQ,uBAAR,QAAQ,CAAE,OAAO,0CAAE,OAAO,0CAAE,OAAO,0CAAE,IAAI,CAC9D,UAAC,MAAM,IAAK,OAAA,MAAM,YAAY,4BAAmB,EAArC,CAAqC,CAClD,CAAC;QACF,IAAI,CAAC,cAAc,EAAE;YACnB,OAAO,IAAI,CAAC,oDAAoD,CAAC,CAAC;SACnE;QACD,MAAM,CAAC,cAAc,YAAY,4BAAmB,CAAC,CAAC,UAAU,EAAE,CAAC;QACnE,MAAM,CAAE,cAAsC,CAAC,KAAK,CAAC,CAAC,WAAW,EAAE,CAAC;QAEpE,eAAe;QACf,QAAQ,CAAC,GAAG,CAAC,UAAC,GAAG,EAAE,KAAK;YACtB,IAAI,GAAG,EAAE;gBACP,IAAI,CAAC,GAAG,CAAC,CAAC;gBACV,OAAO;aACR;YACD,MAAM,CAAC,KAAK,CAAC,CAAC,WAAW,EAAE,CAAC;YAC5B,IAAM,OAAO,GAAG,KAAK,aAAL,KAAK,uBAAL,KAAK,CAAE,MAAM,EAAE,CAAC;YAChC,MAAM,CAAC,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,WAAW,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;YACxC,IAAI,EAAE,CAAC;QACT,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,6BAA6B,EAAE,UAAC,IAAI;QACrC,IAAM,UAAU,GAAG,IAAI,4BAAmB,CAAC;YACzC,UAAU,EAAE,UAAG,SAAS,mDAAgD;YACxE,QAAQ,EAAE,MAAM;YAChB,UAAU,EAAE,CAAC,KAAK,EAAE,MAAM,CAAC;YAC3B,UAAU,EAAE,CAAC,SAAS,EAAE,MAAM,CAAC;YAC/B,UAAU,EAAE,CAAC,UAAG,SAAS,0CAAuC,CAAC;SAClE,CAAC,CAAC;QACH,MAAM,CAAC,UAAU,CAAC,CAAC,cAAc,CAAC,4BAAmB,CAAC,CAAC;QAEvD,IAAM,YAAY,yBACb,QAAQ,KACX,OAAO,EAAE;gBACP,UAAU,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,CAAC;gBAClC,OAAO,EAAE,CAAC,UAAU,CAAC;aACtB,GACF,CAAC;QAEF,IAAM,QAAQ,GAAG,OAAO,CAAC,YAAY,CAAC,CAAC;QAEvC,QAAQ,CAAC,GAAG,CAAC,UAAC,GAAG,EAAE,KAAK;YACtB,IAAI,GAAG,EAAE;gBACP,IAAI,CAAC,GAAG,CAAC,CAAC;gBACV,OAAO;aACR;YACD,MAAM,CAAC,KAAK,CAAC,CAAC,WAAW,EAAE,CAAC;YAE5B,IAAM,OAAO,GAAG,KAAK,aAAL,KAAK,uBAAL,KAAK,CAAE,MAAM,EAAE,CAAC;YAChC,MAAM,CAAC,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,WAAW,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;YACxC,sFAAsF;YACtF,IAAI,EAAE,CAAC;QACT,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}

View File

@@ -0,0 +1,3 @@
export { TsconfigPathsPlugin } from "./plugin";
import { TsconfigPathsPlugin } from "./plugin";
export default TsconfigPathsPlugin;

View File

@@ -0,0 +1,16 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.TsconfigPathsPlugin = void 0;
var plugin_1 = require("./plugin");
Object.defineProperty(exports, "TsconfigPathsPlugin", { enumerable: true, get: function () { return plugin_1.TsconfigPathsPlugin; } });
var plugin_2 = require("./plugin");
exports.default = plugin_2.TsconfigPathsPlugin;
// This is to make it importable in all these ways
// const TsconfigPathsPlugin = require('tsconfig-paths-webpack-plugin');
// import TsconfigPathsPlugin from "tsconfig-paths-webpack-plugin";
// import { TsconfigPathsPlugin } from "tsconfig-paths-webpack-plugin";
var theClass = require("./plugin").TsconfigPathsPlugin;
theClass.TsconfigPathsPlugin = plugin_2.TsconfigPathsPlugin;
theClass.default = plugin_2.TsconfigPathsPlugin;
module.exports = theClass;
//# sourceMappingURL=index.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;AAAA,mCAA+C;AAAtC,6GAAA,mBAAmB,OAAA;AAC5B,mCAA+C;AAC/C,kBAAe,4BAAmB,CAAC;AAEnC,kDAAkD;AAClD,wEAAwE;AACxE,mEAAmE;AACnE,uEAAuE;AACvE,IAAM,QAAQ,GAAG,OAAO,CAAC,UAAU,CAAC,CAAC,mBAAmB,CAAC;AACzD,QAAQ,CAAC,mBAAmB,GAAG,4BAAmB,CAAC;AACnD,QAAQ,CAAC,OAAO,GAAG,4BAAmB,CAAC;AACvC,MAAM,CAAC,OAAO,GAAG,QAAQ,CAAC"}

View File

@@ -0,0 +1,10 @@
import { Options } from "./options";
import { Chalk } from "chalk";
export type LoggerFunc = (message: string) => void;
export interface Logger {
log: LoggerFunc;
logInfo: LoggerFunc;
logWarning: LoggerFunc;
logError: LoggerFunc;
}
export declare function makeLogger(options: Options, colors: Chalk): Logger;

View File

@@ -0,0 +1,53 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.makeLogger = void 0;
var console_1 = require("console");
var LogLevel;
(function (LogLevel) {
LogLevel[LogLevel["INFO"] = 1] = "INFO";
LogLevel[LogLevel["WARN"] = 2] = "WARN";
LogLevel[LogLevel["ERROR"] = 3] = "ERROR";
})(LogLevel || (LogLevel = {}));
var stderrConsole = new console_1.Console(process.stderr);
var stdoutConsole = new console_1.Console(process.stdout);
var doNothingLogger = function (_message) {
/* Do nothing */
};
var makeLoggerFunc = function (options) {
return options.silent
? function (_whereToLog, _message) {
/* Do nothing */
}
: function (whereToLog, message) { return whereToLog.log(message); };
};
var makeExternalLogger = function (loaderOptions, logger) { return function (message) {
return logger(loaderOptions.logInfoToStdOut ? stdoutConsole : stderrConsole, message);
}; };
var makeLogInfo = function (options, logger, green) {
return LogLevel[options.logLevel] <= LogLevel.INFO
? function (message) {
return logger(options.logInfoToStdOut ? stdoutConsole : stderrConsole, green(message));
}
: doNothingLogger;
};
var makeLogError = function (options, logger, red) {
return LogLevel[options.logLevel] <= LogLevel.ERROR
? function (message) { return logger(stderrConsole, red(message)); }
: doNothingLogger;
};
var makeLogWarning = function (options, logger, yellow) {
return LogLevel[options.logLevel] <= LogLevel.WARN
? function (message) { return logger(stderrConsole, yellow(message)); }
: doNothingLogger;
};
function makeLogger(options, colors) {
var logger = makeLoggerFunc(options);
return {
log: makeExternalLogger(options, logger),
logInfo: makeLogInfo(options, logger, colors.green),
logWarning: makeLogWarning(options, logger, colors.yellow),
logError: makeLogError(options, logger, colors.red),
};
}
exports.makeLogger = makeLogger;
//# sourceMappingURL=logger.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"logger.js","sourceRoot":"","sources":["../src/logger.ts"],"names":[],"mappings":";;;AAAA,mCAAkC;AAgBlC,IAAK,QAIJ;AAJD,WAAK,QAAQ;IACX,uCAAQ,CAAA;IACR,uCAAQ,CAAA;IACR,yCAAS,CAAA;AACX,CAAC,EAJI,QAAQ,KAAR,QAAQ,QAIZ;AAED,IAAM,aAAa,GAAG,IAAI,iBAAO,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC;AAClD,IAAM,aAAa,GAAG,IAAI,iBAAO,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC;AAElD,IAAM,eAAe,GAAG,UAAC,QAAgB;IACvC,gBAAgB;AAClB,CAAC,CAAC;AAEF,IAAM,cAAc,GAAG,UAAC,OAAgB;IACtC,OAAA,OAAO,CAAC,MAAM;QACZ,CAAC,CAAC,UAAC,WAAoB,EAAE,QAAgB;YACrC,gBAAgB;QAClB,CAAC;QACH,CAAC,CAAC,UAAC,UAAmB,EAAE,OAAe,IAAK,OAAA,UAAU,CAAC,GAAG,CAAC,OAAO,CAAC,EAAvB,CAAuB;AAJrE,CAIqE,CAAC;AAExE,IAAM,kBAAkB,GAAG,UACzB,aAAsB,EACtB,MAA0B,IACX,OAAA,UAAC,OAAe;IAC/B,OAAA,MAAM,CACJ,aAAa,CAAC,eAAe,CAAC,CAAC,CAAC,aAAa,CAAC,CAAC,CAAC,aAAa,EAC7D,OAAO,CACR;AAHD,CAGC,EAJc,CAId,CAAC;AAEJ,IAAM,WAAW,GAAG,UAClB,OAAgB,EAChB,MAA0B,EAC1B,KAAY;IAEZ,OAAA,QAAQ,CAAC,OAAO,CAAC,QAAQ,CAAC,IAAI,QAAQ,CAAC,IAAI;QACzC,CAAC,CAAC,UAAC,OAAe;YACd,OAAA,MAAM,CACJ,OAAO,CAAC,eAAe,CAAC,CAAC,CAAC,aAAa,CAAC,CAAC,CAAC,aAAa,EACvD,KAAK,CAAC,OAAO,CAAC,CACf;QAHD,CAGC;QACL,CAAC,CAAC,eAAe;AANnB,CAMmB,CAAC;AAEtB,IAAM,YAAY,GAAG,UACnB,OAAgB,EAChB,MAA0B,EAC1B,GAAU;IAEV,OAAA,QAAQ,CAAC,OAAO,CAAC,QAAQ,CAAC,IAAI,QAAQ,CAAC,KAAK;QAC1C,CAAC,CAAC,UAAC,OAAe,IAAK,OAAA,MAAM,CAAC,aAAa,EAAE,GAAG,CAAC,OAAO,CAAC,CAAC,EAAnC,CAAmC;QAC1D,CAAC,CAAC,eAAe;AAFnB,CAEmB,CAAC;AAEtB,IAAM,cAAc,GAAG,UACrB,OAAgB,EAChB,MAA0B,EAC1B,MAAa;IAEb,OAAA,QAAQ,CAAC,OAAO,CAAC,QAAQ,CAAC,IAAI,QAAQ,CAAC,IAAI;QACzC,CAAC,CAAC,UAAC,OAAe,IAAK,OAAA,MAAM,CAAC,aAAa,EAAE,MAAM,CAAC,OAAO,CAAC,CAAC,EAAtC,CAAsC;QAC7D,CAAC,CAAC,eAAe;AAFnB,CAEmB,CAAC;AAEtB,SAAgB,UAAU,CAAC,OAAgB,EAAE,MAAa;IACxD,IAAM,MAAM,GAAG,cAAc,CAAC,OAAO,CAAC,CAAC;IACvC,OAAO;QACL,GAAG,EAAE,kBAAkB,CAAC,OAAO,EAAE,MAAM,CAAC;QACxC,OAAO,EAAE,WAAW,CAAC,OAAO,EAAE,MAAM,EAAE,MAAM,CAAC,KAAK,CAAC;QACnD,UAAU,EAAE,cAAc,CAAC,OAAO,EAAE,MAAM,EAAE,MAAM,CAAC,MAAM,CAAC;QAC1D,QAAQ,EAAE,YAAY,CAAC,OAAO,EAAE,MAAM,EAAE,MAAM,CAAC,GAAG,CAAC;KACpD,CAAC;AACJ,CAAC;AARD,gCAQC"}

View File

@@ -0,0 +1,18 @@
export type LogLevel = "INFO" | "WARN" | "ERROR";
export interface Options {
readonly configFile: string;
readonly extensions: ReadonlyArray<string>;
readonly baseUrl: string | undefined;
readonly silent: boolean;
readonly logLevel: LogLevel;
readonly logInfoToStdOut: boolean;
readonly context: string | undefined;
readonly colors: boolean;
readonly mainFields: (string | string[])[];
readonly references: string[] | undefined;
}
/**
* Takes raw options from the webpack config,
* validates them and adds defaults for missing options
*/
export declare function getOptions(rawOptions: {}): Options;

View File

@@ -0,0 +1,68 @@
"use strict";
var __assign = (this && this.__assign) || function () {
__assign = Object.assign || function(t) {
for (var s, i = 1, n = arguments.length; i < n; i++) {
s = arguments[i];
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
t[p] = s[p];
}
return t;
};
return __assign.apply(this, arguments);
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.getOptions = void 0;
var validOptions = [
"configFile",
"extensions",
"baseUrl",
"silent",
"logLevel",
"logInfoToStdOut",
"context",
"mainFields",
"references",
];
/**
* Takes raw options from the webpack config,
* validates them and adds defaults for missing options
*/
function getOptions(rawOptions) {
validateOptions(rawOptions);
var options = makeOptions(rawOptions);
return options;
}
exports.getOptions = getOptions;
/**
* Validate the supplied loader options.
* At present this validates the option names only; in future we may look at validating the values too
*
* @param rawOptions
*/
function validateOptions(rawOptions) {
var loaderOptionKeys = Object.keys(rawOptions);
for (var i = 0; i < loaderOptionKeys.length; i++) {
var option = loaderOptionKeys[i];
var isUnexpectedOption = validOptions.indexOf(option) === -1;
if (isUnexpectedOption) {
throw new Error("tsconfig-paths-webpack-plugin was supplied with an unexpected loader option: ".concat(option, "\nPlease take a look at the options you are supplying; the following are valid options:\n").concat(validOptions.join(" / "), "\n"));
}
}
}
function makeOptions(rawOptions) {
var options = __assign(__assign({}, {
configFile: "tsconfig.json",
extensions: [".ts", ".tsx"],
baseUrl: undefined,
silent: false,
logLevel: "WARN",
logInfoToStdOut: false,
context: undefined,
colors: true,
mainFields: ["main"],
references: undefined,
}), rawOptions);
var options2 = __assign(__assign({}, options), { logLevel: options.logLevel.toUpperCase() });
return options2;
}
//# sourceMappingURL=options.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"options.js","sourceRoot":"","sources":["../src/options.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAgBA,IAAM,YAAY,GAAgC;IAChD,YAAY;IACZ,YAAY;IACZ,SAAS;IACT,QAAQ;IACR,UAAU;IACV,iBAAiB;IACjB,SAAS;IACT,YAAY;IACZ,YAAY;CACb,CAAC;AAEF;;;GAGG;AACH,SAAgB,UAAU,CAAC,UAAc;IACvC,eAAe,CAAC,UAAU,CAAC,CAAC;IAE5B,IAAM,OAAO,GAAG,WAAW,CAAC,UAAU,CAAC,CAAC;IAExC,OAAO,OAAO,CAAC;AACjB,CAAC;AAND,gCAMC;AAED;;;;;GAKG;AACH,SAAS,eAAe,CAAC,UAAc;IACrC,IAAM,gBAAgB,GAAG,MAAM,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;IACjD,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,gBAAgB,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;QAChD,IAAM,MAAM,GAAG,gBAAgB,CAAC,CAAC,CAAC,CAAC;QACnC,IAAM,kBAAkB,GACrB,YAAsC,CAAC,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC;QACjE,IAAI,kBAAkB,EAAE;YACtB,MAAM,IAAI,KAAK,CAAC,uFAAgF,MAAM,sGAE1G,YAAY,CAAC,IAAI,CAAC,KAAK,CAAC,OACzB,CAAC,CAAC;SACE;KACF;AACH,CAAC;AAED,SAAS,WAAW,CAAC,UAA4B;IAC/C,IAAM,OAAO,yBACP;QACF,UAAU,EAAE,eAAe;QAC3B,UAAU,EAAE,CAAC,KAAK,EAAE,MAAM,CAAC;QAC3B,OAAO,EAAE,SAAS;QAClB,MAAM,EAAE,KAAK;QACb,QAAQ,EAAE,MAAM;QAChB,eAAe,EAAE,KAAK;QACtB,OAAO,EAAE,SAAS;QAClB,MAAM,EAAE,IAAI;QACZ,UAAU,EAAE,CAAC,MAAM,CAAC;QACpB,UAAU,EAAE,SAAS;KACV,GACV,UAAU,CACd,CAAC;IAEF,IAAM,QAAQ,yBACT,OAAO,KACV,QAAQ,EAAE,OAAO,CAAC,QAAQ,CAAC,WAAW,EAAc,GACrD,CAAC;IAEF,OAAO,QAAQ,CAAC;AAClB,CAAC"}

View File

@@ -0,0 +1,65 @@
/// <reference types="node" />
import * as TsconfigPaths from "tsconfig-paths";
import * as Options from "./options";
import * as Logger from "./logger";
import * as fs from "fs";
import { ResolvePluginInstance, Resolver } from "webpack";
import { AsyncSeriesBailHook } from "tapable";
import { ResolveContext, ResolveRequest } from "enhanced-resolve";
export interface LegacyResolverPlugin {
readonly apply: (resolver: LegacyResolver) => void;
}
export interface LegacyResolver {
readonly apply: (plugin: LegacyResolverPlugin) => void;
readonly plugin: (source: string, cb: ResolverCallbackLegacy) => void;
readonly doResolve: doResolveLegacy | doResolve;
readonly join: (relativePath: string, innerRequest: Request) => Request;
readonly fileSystem: LegacyResolverFileSystem;
readonly getHook: (hook: string) => AsyncSeriesBailHook<[
ResolveRequest,
ResolveContext
], null | ResolveRequest>;
}
export type doResolveLegacy = (target: string, req: Request, desc: string, callback: Callback) => void;
export type doResolve = (hook: AsyncSeriesBailHook<[
ResolveRequest,
ResolveContext
], null | ResolveRequest>, req: Request, message: string, resolveContext: LegacyResolveContext, callback: Callback) => void;
export type ReadJsonCallback = (error: Error | undefined | null, result?: {}) => void;
export type ReadJson = (path2: string, callback: ReadJsonCallback) => void;
export type LegacyResolverFileSystem = typeof fs & {
readJson?: ReadJson;
};
export interface LegacyResolveContext {
log?: string;
stack?: string;
missing?: string;
}
export type ResolverCallbackLegacy = (request: Request, callback: Callback) => void;
export type ResolverCallback = (request: Request, resolveContext: LegacyResolveContext, callback: Callback) => void;
export interface Request {
readonly request?: Request | string;
readonly relativePath: string;
readonly path: string;
readonly context: {
readonly issuer: string;
};
}
export interface Callback {
(err?: Error, result?: string): void;
log?: string;
stack?: string;
missing?: string;
}
export declare class TsconfigPathsPlugin implements Exclude<ResolvePluginInstance, Function> {
source: string;
target: string;
log: Logger.Logger;
baseUrl: string | undefined;
absoluteBaseUrl: string;
extensions: ReadonlyArray<string>;
referenceMatchMap: Record<string, TsconfigPaths.MatchPathAsync>;
matchPath: TsconfigPaths.MatchPathAsync;
constructor(rawOptions?: Partial<Options.Options>);
apply(resolver: Resolver): void;
}

View File

@@ -0,0 +1,238 @@
"use strict";
var __assign = (this && this.__assign) || function () {
__assign = Object.assign || function(t) {
for (var s, i = 1, n = arguments.length; i < n; i++) {
s = arguments[i];
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
t[p] = s[p];
}
return t;
};
return __assign.apply(this, arguments);
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.TsconfigPathsPlugin = void 0;
var chalk = require("chalk");
var TsconfigPaths = require("tsconfig-paths");
var path = require("path");
var Options = require("./options");
var Logger = require("./logger");
// eslint-disable-next-line no-redeclare
var getInnerRequest = require("enhanced-resolve/lib/getInnerRequest");
var TsconfigPathsPlugin = /** @class */ (function () {
function TsconfigPathsPlugin(rawOptions) {
if (rawOptions === void 0) { rawOptions = {}; }
var _this = this;
this.source = "described-resolve";
this.target = "resolve";
var options = Options.getOptions(rawOptions);
this.extensions = options.extensions;
this.referenceMatchMap = {};
// const colors = new chalk.constructor({ enabled: options.colors });
this.log = Logger.makeLogger(options, new chalk.Instance({ level: options.colors ? undefined : 0 }));
var context = options.context || process.cwd();
var loadFrom = options.configFile || context;
var loadResult = loadConfig(loadFrom, this.log);
if (loadResult.resultType === "success") {
this.baseUrl = options.baseUrl || loadResult.baseUrl;
this.absoluteBaseUrl = options.baseUrl
? path.resolve(options.baseUrl)
: loadResult.absoluteBaseUrl;
this.matchPath = TsconfigPaths.createMatchPathAsync(this.absoluteBaseUrl, loadResult.paths, options.mainFields);
if (options.references) {
options.references.reduce(function (pathMap, reference) {
if (reference) {
var referenceResult = loadConfig(reference, _this.log);
if (referenceResult.resultType === "success") {
var paths = referenceResult.paths, absoluteBaseUrl = referenceResult.absoluteBaseUrl;
pathMap[absoluteBaseUrl] = TsconfigPaths.createMatchPathAsync(absoluteBaseUrl, paths, options.mainFields);
}
}
return pathMap;
}, this.referenceMatchMap);
}
}
}
TsconfigPathsPlugin.prototype.apply = function (resolver) {
if (!resolver) {
this.log.logWarning("tsconfig-paths-webpack-plugin: Found no resolver, not applying tsconfig-paths-webpack-plugin");
return;
}
// The file system only exists when the plugin is in the resolve context. This means it's also properly placed in the resolve.plugins array.
// If not, we should warn the user that this plugin should be placed in resolve.plugins and not the plugins array of the root config for example.
// This should hopefully prevent issues like: https://github.com/dividab/tsconfig-paths-webpack-plugin/issues/9
if (!("fileSystem" in resolver)) {
this.log.logWarning("tsconfig-paths-webpack-plugin: No file system found on resolver." +
" Please make sure you've placed the plugin in the correct part of the configuration." +
" This plugin is a resolver plugin and should be placed in the resolve part of the Webpack configuration.");
return;
}
// getHook will only exist in Webpack 4 & 5, if so we should comply to the Webpack 4 plugin system.
if ("getHook" in resolver && typeof resolver.getHook === "function") {
resolver
.getHook(this.source)
.tapAsync({ name: "TsconfigPathsPlugin" }, createPluginCallback(this.referenceMatchMap, this.matchPath, resolver, this.absoluteBaseUrl, resolver.getHook(this.target), this.extensions));
}
else if ("plugin" in resolver) {
// This is the legacy (Webpack < 4.0.0) way of using the plugin system.
var legacyResolver = resolver;
legacyResolver.plugin(this.source, createPluginLegacy(this.matchPath, resolver, this.absoluteBaseUrl, this.target, this.extensions));
}
};
return TsconfigPathsPlugin;
}());
exports.TsconfigPathsPlugin = TsconfigPathsPlugin;
function loadConfig(configPath, logger) {
var loadResult = TsconfigPaths.loadConfig(configPath);
if (loadResult.resultType === "failed") {
logger.logError("Failed to load ".concat(configPath, ": ").concat(loadResult.message));
}
else {
logger.logInfo("tsconfig-paths-webpack-plugin: Using config file at ".concat(loadResult.configFileAbsolutePath));
}
return loadResult;
}
function createPluginCallback(referenceMatchMap, baseMatchPath, resolver, baseAbsoluteBaseUrl, hook, extensions) {
var fileExistAsync = createFileExistAsync(resolver.fileSystem);
var readJsonAsync = createReadJsonAsync(resolver.fileSystem);
return function (request, resolveContext, callback) {
var _a, _b;
var innerRequest = getInnerRequest(resolver, request);
if (!innerRequest ||
((_a = request === null || request === void 0 ? void 0 : request.request) === null || _a === void 0 ? void 0 : _a.startsWith(".")) ||
((_b = request === null || request === void 0 ? void 0 : request.request) === null || _b === void 0 ? void 0 : _b.startsWith(".."))) {
return callback();
}
// Find the base URL and matchPath instance
// Quickly check if the request path is a known baseUrl
// Then check if the path is a child of a reference baseUrl
var absoluteBaseUrl = baseAbsoluteBaseUrl;
if (typeof request.path === "string" &&
request.path !== baseAbsoluteBaseUrl) {
if (referenceMatchMap[request.path]) {
absoluteBaseUrl = request.path;
}
else {
var referenceUrl = Object.keys(referenceMatchMap).find(function (refBaseUrl) {
var relative = path.relative(refBaseUrl, request.path || "");
return (relative &&
!relative.startsWith("..") &&
!path.isAbsolute(relative));
});
if (referenceUrl) {
absoluteBaseUrl = referenceUrl;
}
}
}
var matchPath = referenceMatchMap[absoluteBaseUrl] || baseMatchPath;
matchPath(innerRequest, readJsonAsync, fileExistAsync, extensions, function (err, foundMatch) {
if (err) {
return callback(err);
}
if (!foundMatch) {
return callback();
}
var newRequest = __assign(__assign({}, request), { request: foundMatch, path: absoluteBaseUrl });
// Only at this point we are sure we are dealing with the latest Webpack version (>= 4.0.0)
// So only now can we require the createInnerContext function.
// (It doesn't exist in legacy versions)
var createInnerContext = require("enhanced-resolve/lib/createInnerContext");
return resolver.doResolve(hook, newRequest, "Resolved request '".concat(innerRequest, "' to '").concat(foundMatch, "' using tsconfig.json paths mapping"),
// eslint-disable-next-line @typescript-eslint/no-explicit-any
createInnerContext(__assign({}, resolveContext)), function (err2, result2) {
// Pattern taken from:
// https://github.com/webpack/enhanced-resolve/blob/42ff594140582c3f8f86811f95dea7bf6774a1c8/lib/AliasPlugin.js#L44
if (err2) {
return callback(err2);
}
// Don't allow other aliasing or raw request
if (result2 === undefined) {
return callback(undefined, undefined);
}
callback(undefined, result2);
});
});
};
}
function createPluginLegacy(matchPath, resolver, absoluteBaseUrl, target, extensions) {
var fileExistAsync = createFileExistAsync(resolver.fileSystem);
var readJsonAsync = createReadJsonAsync(resolver.fileSystem);
return function (request, callback) {
var innerRequest = getInnerRequest(resolver, request);
if (!innerRequest ||
innerRequest.startsWith(".") ||
innerRequest.startsWith("..")) {
return callback();
}
matchPath(innerRequest, readJsonAsync, fileExistAsync, extensions, function (err, foundMatch) {
if (err) {
return callback(err);
}
if (!foundMatch) {
return callback();
}
var newRequest = __assign(__assign({}, request), { request: foundMatch, path: absoluteBaseUrl });
// Only at this point we are sure we are dealing with a legacy Webpack version (< 4.0.0)
// So only now can we require the createInnerCallback function.
// (It's already deprecated and might be removed down the line).
var createInnerCallback = require("enhanced-resolve/lib/createInnerCallback");
return resolver.doResolve(target, newRequest, "Resolved request '".concat(innerRequest, "' to '").concat(foundMatch, "' using tsconfig.json paths mapping"), createInnerCallback(function (err2, result2) {
// Note:
// *NOT* using an arrow function here because arguments.length implies we have "this"
// That means "this" has to be in the current function scope, and not the scope above.
// Pattern taken from:
// https://github.com/s-panferov/awesome-typescript-loader/blob/10653beff85f555f1f3b5d4bfd7d21513d0e54a4/src/paths-plugin.ts#L169
if (arguments.length > 0) {
return callback(err2, result2);
}
// don't allow other aliasing or raw request
callback(undefined, undefined);
}, callback));
});
};
}
function readJson(fileSystem, path2, callback) {
if ("readJson" in fileSystem && fileSystem.readJson) {
return fileSystem.readJson(path2, callback);
}
fileSystem.readFile(path2, function (err, buf) {
if (err) {
return callback(err);
}
var data;
try {
// @ts-ignore This will crash if buf is undefined, which I guess it can be...
data = JSON.parse(buf.toString("utf-8"));
}
catch (e) {
return callback(e);
}
return callback(undefined, data);
});
}
function createReadJsonAsync(filesystem) {
// eslint-disable-next-line @typescript-eslint/no-explicit-any
return function (path2, callback2) {
readJson(filesystem, path2, function (err, json) {
// If error assume file does not exist
if (err || !json) {
callback2();
return;
}
callback2(undefined, json);
});
};
}
function createFileExistAsync(filesystem) {
return function (path2, callback2) {
filesystem.stat(path2, function (err, stats) {
// If error assume file does not exist
if (err) {
callback2(undefined, false);
return;
}
callback2(undefined, stats ? stats.isFile() : false);
});
};
}
//# sourceMappingURL=plugin.js.map

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,56 @@
{
"name": "tsconfig-paths-webpack-plugin",
"version": "4.2.0",
"description": "Load modules according to tsconfig paths in webpack.",
"main": "lib/index.js",
"types": "lib/index",
"author": "Jonas Kello",
"license": "MIT",
"repository": "https://github.com/dividab/tsconfig-paths-webpack-plugin",
"dependencies": {
"chalk": "^4.1.0",
"enhanced-resolve": "^5.7.0",
"tapable": "^2.2.1",
"tsconfig-paths": "^4.1.2"
},
"devDependencies": {
"@types/jest": "^27.0.3",
"@types/node": "^14.14.34",
"@typescript-eslint/eslint-plugin": "^5.22.0",
"@typescript-eslint/parser": "^5.22.0",
"eslint": "^8.14.0",
"eslint-config-prettier": "^8.5.0",
"eslint-plugin-import": "^2.26.0",
"eslint-plugin-jsdoc": "^50.4.3",
"husky": "^5.1.3",
"jest": "^27.3.1",
"jest-mock-process": "^1.4.0",
"lint-staged": "^10.5.4",
"prettier": "^2.2.1",
"rimraf": "^3.0.2",
"ts-jest": "^27.0.7",
"ts-loader": "^8.0.18",
"typescript": "^4.2.3",
"webpack": "^5.94.0",
"webpack-cli": "^4.5.0"
},
"scripts": {
"prepare": "husky install",
"compile:example": "tsc -p examples/example",
"example": "yarn build && cd examples/example && webpack && node custom-fs.js",
"build": "rimraf lib && tsc -p .",
"lint": "eslint \"./{src,tests}/**/*.ts{,x}\" --ext .js,.ts,.tsx -f visualstudio",
"test": "jest",
"test-coverage": "jest --coverage",
"verify": "yarn build && yarn lint && yarn test-coverage",
"preversion": "yarn verify",
"postversion": "git push --tags && yarn publish --new-version $npm_package_version && git push && echo \"Successfully released version $npm_package_version!\""
},
"engines": {
"node": ">=10.13.0"
},
"lint-staged": {
"*.{ts,tsx}": "eslint",
"*.{ts,tsx,json,css}": "prettier --write"
}
}

View File

@@ -0,0 +1,146 @@
/*
* ATTENTION: The "eval" devtool has been used (maybe by default in mode: "development").
* This devtool is neither made for production nor for readable output files.
* It uses "eval()" calls to create a separate source file in the browser devtools.
* If you are trying to read the output file, select a different devtool (https://webpack.js.org/configuration/devtool/)
* or disable the default devtool with "devtool: false".
* If you are looking for production-ready output files, see mode: "production" (https://webpack.js.org/configuration/mode/).
*/
/******/ (() => { // webpackBootstrap
/******/ "use strict";
/******/ var __webpack_modules__ = ({
/***/ "../../../examples/example/src/index.ts":
/*!**********************************************!*\
!*** ../../../examples/example/src/index.ts ***!
\**********************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var foo__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! foo */ \"../../../examples/example/src/mapped/foo/index.ts\");\n/* harmony import */ var bar_file1__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! bar/file1 */ \"../../../examples/example/src/mapped/bar/file1.ts\");\n/* harmony import */ var star_bar__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! star-bar */ \"../../../examples/example/src/mapped/star/star-bar/index.ts\");\n/* harmony import */ var browser_field_package__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! browser-field-package */ \"../../../examples/example/src/mapped/star/browser-field-package/browser.ts\");\n/* harmony import */ var main_field_package__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! main-field-package */ \"../../../examples/example/src/mapped/star/main-field-package/node.ts\");\n/* harmony import */ var no_main_field_package__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! no-main-field-package */ \"../../../examples/example/src/mapped/star/no-main-field-package/index.ts\");\n\n\n\n\n\n\n\nconsole.log(\n \"HELLO WORLD!\",\n foo__WEBPACK_IMPORTED_MODULE_0__.message,\n bar_file1__WEBPACK_IMPORTED_MODULE_1__.message,\n star_bar__WEBPACK_IMPORTED_MODULE_2__.message,\n browser_field_package__WEBPACK_IMPORTED_MODULE_3__.message,\n main_field_package__WEBPACK_IMPORTED_MODULE_4__.message,\n no_main_field_package__WEBPACK_IMPORTED_MODULE_5__.message\n);\n\n\n//# sourceURL=webpack:///../../../examples/example/src/index.ts?");
/***/ }),
/***/ "../../../examples/example/src/mapped/bar/file1.ts":
/*!*********************************************************!*\
!*** ../../../examples/example/src/mapped/bar/file1.ts ***!
\*********************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ message: () => (/* binding */ message)\n/* harmony export */ });\nconst message = \"bar\";\n\n\n//# sourceURL=webpack:///../../../examples/example/src/mapped/bar/file1.ts?");
/***/ }),
/***/ "../../../examples/example/src/mapped/foo/index.ts":
/*!*********************************************************!*\
!*** ../../../examples/example/src/mapped/foo/index.ts ***!
\*********************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ message: () => (/* binding */ message)\n/* harmony export */ });\nconst message = \"HELLO!\";\n\n\n//# sourceURL=webpack:///../../../examples/example/src/mapped/foo/index.ts?");
/***/ }),
/***/ "../../../examples/example/src/mapped/star/browser-field-package/browser.ts":
/*!**********************************************************************************!*\
!*** ../../../examples/example/src/mapped/star/browser-field-package/browser.ts ***!
\**********************************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ message: () => (/* binding */ message)\n/* harmony export */ });\nconst message = \"browser\";\n\n\n//# sourceURL=webpack:///../../../examples/example/src/mapped/star/browser-field-package/browser.ts?");
/***/ }),
/***/ "../../../examples/example/src/mapped/star/main-field-package/node.ts":
/*!****************************************************************************!*\
!*** ../../../examples/example/src/mapped/star/main-field-package/node.ts ***!
\****************************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ message: () => (/* binding */ message)\n/* harmony export */ });\nconst message = \"node\";\n\n\n//# sourceURL=webpack:///../../../examples/example/src/mapped/star/main-field-package/node.ts?");
/***/ }),
/***/ "../../../examples/example/src/mapped/star/no-main-field-package/index.ts":
/*!********************************************************************************!*\
!*** ../../../examples/example/src/mapped/star/no-main-field-package/index.ts ***!
\********************************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ message: () => (/* binding */ message)\n/* harmony export */ });\nconst message = \"index\";\n\n\n//# sourceURL=webpack:///../../../examples/example/src/mapped/star/no-main-field-package/index.ts?");
/***/ }),
/***/ "../../../examples/example/src/mapped/star/star-bar/index.ts":
/*!*******************************************************************!*\
!*** ../../../examples/example/src/mapped/star/star-bar/index.ts ***!
\*******************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ message: () => (/* binding */ message)\n/* harmony export */ });\nconst message = \"Hello Star!\";\n\n\n//# sourceURL=webpack:///../../../examples/example/src/mapped/star/star-bar/index.ts?");
/***/ })
/******/ });
/************************************************************************/
/******/ // The module cache
/******/ var __webpack_module_cache__ = {};
/******/
/******/ // The require function
/******/ function __webpack_require__(moduleId) {
/******/ // Check if module is in cache
/******/ var cachedModule = __webpack_module_cache__[moduleId];
/******/ if (cachedModule !== undefined) {
/******/ return cachedModule.exports;
/******/ }
/******/ // Create a new module (and put it into the cache)
/******/ var module = __webpack_module_cache__[moduleId] = {
/******/ // no module.id needed
/******/ // no module.loaded needed
/******/ exports: {}
/******/ };
/******/
/******/ // Execute the module function
/******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__);
/******/
/******/ // Return the exports of the module
/******/ return module.exports;
/******/ }
/******/
/************************************************************************/
/******/ /* webpack/runtime/define property getters */
/******/ (() => {
/******/ // define getter functions for harmony exports
/******/ __webpack_require__.d = (exports, definition) => {
/******/ for(var key in definition) {
/******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {
/******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });
/******/ }
/******/ }
/******/ };
/******/ })();
/******/
/******/ /* webpack/runtime/hasOwnProperty shorthand */
/******/ (() => {
/******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))
/******/ })();
/******/
/******/ /* webpack/runtime/make namespace object */
/******/ (() => {
/******/ // define __esModule on exports
/******/ __webpack_require__.r = (exports) => {
/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
/******/ }
/******/ Object.defineProperty(exports, '__esModule', { value: true });
/******/ };
/******/ })();
/******/
/************************************************************************/
/******/
/******/ // startup
/******/ // Load entry module and return exports
/******/ // This entry module can't be inlined because the eval devtool is used.
/******/ var __webpack_exports__ = __webpack_require__("../../../examples/example/src/index.ts");
/******/
/******/ })()
;

View File

@@ -0,0 +1,146 @@
/*
* ATTENTION: The "eval" devtool has been used (maybe by default in mode: "development").
* This devtool is neither made for production nor for readable output files.
* It uses "eval()" calls to create a separate source file in the browser devtools.
* If you are trying to read the output file, select a different devtool (https://webpack.js.org/configuration/devtool/)
* or disable the default devtool with "devtool: false".
* If you are looking for production-ready output files, see mode: "production" (https://webpack.js.org/configuration/mode/).
*/
/******/ (() => { // webpackBootstrap
/******/ "use strict";
/******/ var __webpack_modules__ = ({
/***/ "./examples/example/src/index.ts":
/*!***************************************!*\
!*** ./examples/example/src/index.ts ***!
\***************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var foo__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! foo */ \"./examples/example/src/mapped/foo/index.ts\");\n/* harmony import */ var bar_file1__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! bar/file1 */ \"./examples/example/src/mapped/bar/file1.ts\");\n/* harmony import */ var star_bar__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! star-bar */ \"./examples/example/src/mapped/star/star-bar/index.ts\");\n/* harmony import */ var browser_field_package__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! browser-field-package */ \"./examples/example/src/mapped/star/browser-field-package/node.ts\");\n/* harmony import */ var main_field_package__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! main-field-package */ \"./examples/example/src/mapped/star/main-field-package/node.ts\");\n/* harmony import */ var no_main_field_package__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! no-main-field-package */ \"./examples/example/src/mapped/star/no-main-field-package/index.ts\");\n\n\n\n\n\n\n\nconsole.log(\n \"HELLO WORLD!\",\n foo__WEBPACK_IMPORTED_MODULE_0__.message,\n bar_file1__WEBPACK_IMPORTED_MODULE_1__.message,\n star_bar__WEBPACK_IMPORTED_MODULE_2__.message,\n browser_field_package__WEBPACK_IMPORTED_MODULE_3__.message,\n main_field_package__WEBPACK_IMPORTED_MODULE_4__.message,\n no_main_field_package__WEBPACK_IMPORTED_MODULE_5__.message\n);\n\n\n//# sourceURL=webpack://tsconfig-paths-webpack-plugin/./examples/example/src/index.ts?");
/***/ }),
/***/ "./examples/example/src/mapped/bar/file1.ts":
/*!**************************************************!*\
!*** ./examples/example/src/mapped/bar/file1.ts ***!
\**************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ message: () => (/* binding */ message)\n/* harmony export */ });\nconst message = \"bar\";\n\n\n//# sourceURL=webpack://tsconfig-paths-webpack-plugin/./examples/example/src/mapped/bar/file1.ts?");
/***/ }),
/***/ "./examples/example/src/mapped/foo/index.ts":
/*!**************************************************!*\
!*** ./examples/example/src/mapped/foo/index.ts ***!
\**************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ message: () => (/* binding */ message)\n/* harmony export */ });\nconst message = \"HELLO!\";\n\n\n//# sourceURL=webpack://tsconfig-paths-webpack-plugin/./examples/example/src/mapped/foo/index.ts?");
/***/ }),
/***/ "./examples/example/src/mapped/star/browser-field-package/node.ts":
/*!************************************************************************!*\
!*** ./examples/example/src/mapped/star/browser-field-package/node.ts ***!
\************************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ message: () => (/* binding */ message)\n/* harmony export */ });\nconst message = \"node\";\n\n\n//# sourceURL=webpack://tsconfig-paths-webpack-plugin/./examples/example/src/mapped/star/browser-field-package/node.ts?");
/***/ }),
/***/ "./examples/example/src/mapped/star/main-field-package/node.ts":
/*!*********************************************************************!*\
!*** ./examples/example/src/mapped/star/main-field-package/node.ts ***!
\*********************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ message: () => (/* binding */ message)\n/* harmony export */ });\nconst message = \"node\";\n\n\n//# sourceURL=webpack://tsconfig-paths-webpack-plugin/./examples/example/src/mapped/star/main-field-package/node.ts?");
/***/ }),
/***/ "./examples/example/src/mapped/star/no-main-field-package/index.ts":
/*!*************************************************************************!*\
!*** ./examples/example/src/mapped/star/no-main-field-package/index.ts ***!
\*************************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ message: () => (/* binding */ message)\n/* harmony export */ });\nconst message = \"index\";\n\n\n//# sourceURL=webpack://tsconfig-paths-webpack-plugin/./examples/example/src/mapped/star/no-main-field-package/index.ts?");
/***/ }),
/***/ "./examples/example/src/mapped/star/star-bar/index.ts":
/*!************************************************************!*\
!*** ./examples/example/src/mapped/star/star-bar/index.ts ***!
\************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ message: () => (/* binding */ message)\n/* harmony export */ });\nconst message = \"Hello Star!\";\n\n\n//# sourceURL=webpack://tsconfig-paths-webpack-plugin/./examples/example/src/mapped/star/star-bar/index.ts?");
/***/ })
/******/ });
/************************************************************************/
/******/ // The module cache
/******/ var __webpack_module_cache__ = {};
/******/
/******/ // The require function
/******/ function __webpack_require__(moduleId) {
/******/ // Check if module is in cache
/******/ var cachedModule = __webpack_module_cache__[moduleId];
/******/ if (cachedModule !== undefined) {
/******/ return cachedModule.exports;
/******/ }
/******/ // Create a new module (and put it into the cache)
/******/ var module = __webpack_module_cache__[moduleId] = {
/******/ // no module.id needed
/******/ // no module.loaded needed
/******/ exports: {}
/******/ };
/******/
/******/ // Execute the module function
/******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__);
/******/
/******/ // Return the exports of the module
/******/ return module.exports;
/******/ }
/******/
/************************************************************************/
/******/ /* webpack/runtime/define property getters */
/******/ (() => {
/******/ // define getter functions for harmony exports
/******/ __webpack_require__.d = (exports, definition) => {
/******/ for(var key in definition) {
/******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {
/******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });
/******/ }
/******/ }
/******/ };
/******/ })();
/******/
/******/ /* webpack/runtime/hasOwnProperty shorthand */
/******/ (() => {
/******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))
/******/ })();
/******/
/******/ /* webpack/runtime/make namespace object */
/******/ (() => {
/******/ // define __esModule on exports
/******/ __webpack_require__.r = (exports) => {
/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
/******/ }
/******/ Object.defineProperty(exports, '__esModule', { value: true });
/******/ };
/******/ })();
/******/
/************************************************************************/
/******/
/******/ // startup
/******/ // Load entry module and return exports
/******/ // This entry module can't be inlined because the eval devtool is used.
/******/ var __webpack_exports__ = __webpack_require__("./examples/example/src/index.ts");
/******/
/******/ })()
;