Bump packages to fix linter
This commit is contained in:
parent
ed9506bbaf
commit
0a11e3fdd9
6063 changed files with 378752 additions and 306784 deletions
21
node_modules/get-tsconfig/LICENSE
generated
vendored
Normal file
21
node_modules/get-tsconfig/LICENSE
generated
vendored
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
MIT License
|
||||
|
||||
Copyright (c) Hiroki Osame <hiroki.osame@gmail.com>
|
||||
|
||||
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.
|
||||
155
node_modules/get-tsconfig/README.md
generated
vendored
Normal file
155
node_modules/get-tsconfig/README.md
generated
vendored
Normal file
|
|
@ -0,0 +1,155 @@
|
|||
# get-tsconfig [](https://npm.im/get-tsconfig)
|
||||
|
||||
Find and parse `tsconfig.json` files.
|
||||
|
||||
### Features
|
||||
- Zero dependency (not even TypeScript)
|
||||
- Tested against TypeScript for correctness
|
||||
- Supports comments & dangling commas in `tsconfig.json`
|
||||
- Resolves [`extends`](https://www.typescriptlang.org/tsconfig/#extends)
|
||||
- Fully typed `tsconfig.json`
|
||||
- Validates and throws parsing errors
|
||||
- Tiny! `3.6 kB` Minified + Gzipped
|
||||
|
||||
## 🚀 Install
|
||||
|
||||
```bash
|
||||
npm install get-tsconfig
|
||||
```
|
||||
|
||||
## 🙋♀️ Why?
|
||||
For TypeScript related tooling to correctly parse `tsconfig.json` file without depending on TypeScript.
|
||||
|
||||
## ⚙️ API
|
||||
|
||||
### getTsconfig(searchPath?, configName?)
|
||||
Searches for a `tsconfig.json` file and parses it. Returns `null` if a config file cannot be found, or an object containing the path and parsed TSConfig object if found.
|
||||
|
||||
Returns:
|
||||
|
||||
```ts
|
||||
type TsconfigResult = {
|
||||
/**
|
||||
* The path to the tsconfig.json file
|
||||
*/
|
||||
path: string
|
||||
|
||||
/**
|
||||
* The resolved tsconfig.json file
|
||||
*/
|
||||
config: TsConfigJsonResolved
|
||||
}
|
||||
```
|
||||
|
||||
#### searchPath
|
||||
Type: `string`
|
||||
|
||||
Default: `process.cwd()`
|
||||
|
||||
Accepts a path to a file or directory to search up for a `tsconfig.json` file.
|
||||
|
||||
#### configName
|
||||
Type: `string`
|
||||
|
||||
Default: `tsconfig.json`
|
||||
|
||||
The file name of the TypeScript config file.
|
||||
|
||||
#### Example
|
||||
|
||||
```ts
|
||||
import { getTsconfig } from 'get-tsconfig'
|
||||
|
||||
// Searches for tsconfig.json starting in the current directory
|
||||
console.log(getTsconfig())
|
||||
|
||||
// Find tsconfig.json from a TypeScript file path
|
||||
console.log(getTsconfig('./path/to/index.ts'))
|
||||
|
||||
// Find tsconfig.json from a directory file path
|
||||
console.log(getTsconfig('./path/to/directory'))
|
||||
|
||||
// Explicitly pass in tsconfig.json path
|
||||
console.log(getTsconfig('./path/to/tsconfig.json'))
|
||||
|
||||
// Search for jsconfig.json - https://code.visualstudio.com/docs/languages/jsconfig
|
||||
console.log(getTsconfig('.', 'jsconfig.json'))
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
### parseTsconfig(tsconfigPath)
|
||||
The `tsconfig.json` parser used internally by `getTsconfig`. Returns the parsed tsconfig as `TsConfigJsonResolved`.
|
||||
|
||||
#### tsconfigPath
|
||||
Type: `string`
|
||||
|
||||
Required path to the tsconfig file.
|
||||
|
||||
#### Example
|
||||
|
||||
```ts
|
||||
import { parseTsconfig } from 'get-tsconfig'
|
||||
|
||||
// Must pass in a path to an existing tsconfig.json file
|
||||
console.log(parseTsconfig('./path/to/tsconfig.custom.json'))
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
### createPathsMatcher(tsconfig: TsconfigResult)
|
||||
|
||||
Given a tsconfig with [`compilerOptions.paths`](https://www.typescriptlang.org/tsconfig#paths) defined, it returns a matcher function.
|
||||
|
||||
The matcher function accepts an [import specifier (the path to resolve)](https://nodejs.org/api/esm.html#terminology), checks it against `compilerOptions.paths`, and returns an array of possible paths to check:
|
||||
```ts
|
||||
function pathsMatcher(specifier: string): string[]
|
||||
```
|
||||
|
||||
This function only returns possible paths and doesn't actually do any resolution. This helps increase compatibility wtih file/build systems which usually have their own resolvers.
|
||||
|
||||
#### Example
|
||||
|
||||
```ts
|
||||
import { getTsconfig, createPathsMatcher } from 'get-tsconfig'
|
||||
|
||||
const tsconfig = getTsconfig()
|
||||
const pathsMatcher = createPathsMatcher(tsconfig)
|
||||
|
||||
function exampleResolver(request: string) {
|
||||
if (pathsMatcher) {
|
||||
const tryPaths = pathsMatcher(request)
|
||||
|
||||
// Check if paths in `tryPaths` exist
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
## FAQ
|
||||
|
||||
### How can I use TypeScript to parse `tsconfig.json`?
|
||||
This package is a re-implementation of TypeScript's `tsconfig.json` parser.
|
||||
|
||||
However, if you already have TypeScript as a dependency, you can simply use it's API:
|
||||
|
||||
```ts
|
||||
import {
|
||||
sys as tsSys,
|
||||
findConfigFile,
|
||||
readConfigFile,
|
||||
parseJsonConfigFileContent
|
||||
} from 'typescript'
|
||||
|
||||
// Find tsconfig.json file
|
||||
const tsconfigPath = findConfigFile(process.cwd(), tsSys.fileExists, 'tsconfig.json')
|
||||
|
||||
// Read tsconfig.json file
|
||||
const tsconfigFile = readConfigFile(tsconfigPath, tsSys.readFile)
|
||||
|
||||
// Resolve extends
|
||||
const parsedTsconfig = parseJsonConfigFileContent(
|
||||
tsconfigFile.config,
|
||||
tsSys,
|
||||
path.dirname(tsconfigPath)
|
||||
)
|
||||
```
|
||||
3
node_modules/get-tsconfig/dist/index.cjs
generated
vendored
Executable file
3
node_modules/get-tsconfig/dist/index.cjs
generated
vendored
Executable file
File diff suppressed because one or more lines are too long
1275
node_modules/get-tsconfig/dist/index.d.cts
generated
vendored
Normal file
1275
node_modules/get-tsconfig/dist/index.d.cts
generated
vendored
Normal file
File diff suppressed because it is too large
Load diff
1275
node_modules/get-tsconfig/dist/index.d.mts
generated
vendored
Normal file
1275
node_modules/get-tsconfig/dist/index.d.mts
generated
vendored
Normal file
File diff suppressed because it is too large
Load diff
3
node_modules/get-tsconfig/dist/index.mjs
generated
vendored
Executable file
3
node_modules/get-tsconfig/dist/index.mjs
generated
vendored
Executable file
File diff suppressed because one or more lines are too long
43
node_modules/get-tsconfig/package.json
generated
vendored
Normal file
43
node_modules/get-tsconfig/package.json
generated
vendored
Normal file
|
|
@ -0,0 +1,43 @@
|
|||
{
|
||||
"name": "get-tsconfig",
|
||||
"version": "4.3.0",
|
||||
"description": "Find and parse the tsconfig.json file from a directory path",
|
||||
"keywords": [
|
||||
"get-tsconfig",
|
||||
"get",
|
||||
"typescript",
|
||||
"tsconfig",
|
||||
"tsconfig.json"
|
||||
],
|
||||
"license": "MIT",
|
||||
"repository": "privatenumber/get-tsconfig",
|
||||
"funding": "https://github.com/privatenumber/get-tsconfig?sponsor=1",
|
||||
"author": {
|
||||
"name": "Hiroki Osame",
|
||||
"email": "hiroki.osame@gmail.com"
|
||||
},
|
||||
"type": "module",
|
||||
"files": [
|
||||
"dist"
|
||||
],
|
||||
"main": "./dist/index.cjs",
|
||||
"module": "./dist/index.mjs",
|
||||
"types": "./dist/index.d.cts",
|
||||
"exports": {
|
||||
"require": {
|
||||
"types": "./dist/index.d.cts",
|
||||
"default": "./dist/index.cjs"
|
||||
},
|
||||
"import": {
|
||||
"types": "./dist/index.d.mts",
|
||||
"default": "./dist/index.mjs"
|
||||
}
|
||||
},
|
||||
"imports": {
|
||||
"#get-tsconfig": {
|
||||
"types": "./src/index.ts",
|
||||
"development": "./src/index.ts",
|
||||
"default": "./dist/index.mjs"
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue