@visulima/tsconfig 3.1.1 → 3.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,17 @@
|
|
|
1
|
+
## @visulima/tsconfig [3.2.1](https://github.com/visulima/visulima/compare/%40visulima%2Ftsconfig%403.2.0...%40visulima%2Ftsconfig%403.2.1) (2026-07-26)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Dependencies
|
|
5
|
+
|
|
6
|
+
* **@visulima/fs:** upgraded to 5.0.6
|
|
7
|
+
|
|
8
|
+
## @visulima/tsconfig [3.2.0](https://github.com/visulima/visulima/compare/%40visulima%2Ftsconfig%403.1.1...%40visulima%2Ftsconfig%403.2.0) (2026-07-19)
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
### Dependencies
|
|
12
|
+
|
|
13
|
+
* **@visulima/fs:** upgraded to 5.0.5
|
|
14
|
+
|
|
1
15
|
## @visulima/tsconfig [3.1.1](https://github.com/visulima/visulima/compare/%40visulima%2Ftsconfig%403.1.0...%40visulima%2Ftsconfig%403.1.1) (2026-07-17)
|
|
2
16
|
|
|
3
17
|
|
package/dist/index.d.ts
CHANGED
|
@@ -72,26 +72,39 @@ type TsConfigResult = {
|
|
|
72
72
|
*/
|
|
73
73
|
declare const findTsConfig: (cwd?: URL | string, options?: Options) => Promise<TsConfigResult>;
|
|
74
74
|
declare const findTsConfigSync: (cwd?: URL | string, options?: Options) => TsConfigResult;
|
|
75
|
+
interface WriteTsConfigOptions extends WriteJsonOptions {
|
|
76
|
+
/** The directory to write the config into. Defaults to `process.cwd()`. */
|
|
77
|
+
cwd?: URL | string;
|
|
78
|
+
/**
|
|
79
|
+
* The file name to write. Defaults to `tsconfig.json`. Useful when emitting a derived project
|
|
80
|
+
* file (e.g. `tsconfig.build.json`) next to an existing config.
|
|
81
|
+
*/
|
|
82
|
+
fileName?: string;
|
|
83
|
+
/**
|
|
84
|
+
* The TypeScript major version the written config targets. When set, compiler options removed in
|
|
85
|
+
* that version are dropped — e.g. `7` removes `baseUrl` so the config is accepted by the
|
|
86
|
+
* TypeScript 7 native compiler.
|
|
87
|
+
*/
|
|
88
|
+
typescriptMajor?: number;
|
|
89
|
+
}
|
|
75
90
|
/**
|
|
76
|
-
* An asynchronous function that writes the provided TypeScript configuration object to a tsconfig
|
|
91
|
+
* An asynchronous function that writes the provided TypeScript configuration object to a tsconfig file.
|
|
92
|
+
*
|
|
93
|
+
* Numeric enum compiler options are normalized to their string names, so a resolved `CompilerOptions`
|
|
94
|
+
* object (e.g. from `readTsConfig`) can be written back to a valid config.
|
|
77
95
|
* @param tsConfig The TypeScript configuration object to write. The type of `tsConfig` is `TsConfigJson`.
|
|
78
|
-
* @param options Optional.
|
|
79
|
-
*
|
|
80
|
-
* @returns A `Promise` that resolves when the tsconfig.json file has been written.
|
|
96
|
+
* @param options Optional. Write options plus the target directory (`cwd`), `fileName`, and `typescriptMajor`.
|
|
97
|
+
* @returns A `Promise` that resolves when the tsconfig file has been written.
|
|
81
98
|
* The return type of function is `Promise<void>`.
|
|
82
99
|
*/
|
|
83
|
-
declare const writeTsConfig: (tsConfig: TsConfigJson, options?:
|
|
84
|
-
cwd?: URL | string;
|
|
85
|
-
}) => Promise<void>;
|
|
100
|
+
declare const writeTsConfig: (tsConfig: TsConfigJson, options?: WriteTsConfigOptions) => Promise<void>;
|
|
86
101
|
/**
|
|
87
|
-
* A function that writes the provided TypeScript configuration object to a tsconfig
|
|
102
|
+
* A function that writes the provided TypeScript configuration object to a tsconfig file.
|
|
103
|
+
*
|
|
104
|
+
* Numeric enum compiler options are normalized to their string names, so a resolved `CompilerOptions`
|
|
105
|
+
* object (e.g. from `readTsConfig`) can be written back to a valid config.
|
|
88
106
|
* @param tsConfig The TypeScript configuration object to write. The type of `tsConfig` is `TsConfigJson`.
|
|
89
|
-
* @param options Optional.
|
|
90
|
-
* intersection type of `WriteOptions` and a Record type with an optional `cwd` key of type `string`.
|
|
91
|
-
* @returns A `Promise` that resolves when the tsconfig.json file has been written.
|
|
92
|
-
* The return type of function is `Promise<void>`.
|
|
107
|
+
* @param options Optional. Write options plus the target directory (`cwd`), `fileName`, and `typescriptMajor`.
|
|
93
108
|
*/
|
|
94
|
-
declare const writeTsConfigSync: (tsConfig: TsConfigJson, options?:
|
|
95
|
-
|
|
96
|
-
}) => void;
|
|
97
|
-
export { type Options as FindTsConfigOptions, type Options$1 as ReadTsConfigOptions, type TsConfigJsonResolved, type TsConfigResult, configDirectoryPlaceholder, findTsConfig, findTsConfigSync, implicitBaseUrlSymbol, readTsConfig, writeTsConfig, writeTsConfigSync };
|
|
109
|
+
declare const writeTsConfigSync: (tsConfig: TsConfigJson, options?: WriteTsConfigOptions) => void;
|
|
110
|
+
export { type Options as FindTsConfigOptions, type Options$1 as ReadTsConfigOptions, type TsConfigJsonResolved, type TsConfigResult, type WriteTsConfigOptions, configDirectoryPlaceholder, findTsConfig, findTsConfigSync, implicitBaseUrlSymbol, readTsConfig, writeTsConfig, writeTsConfigSync };
|
package/dist/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{findTsConfig as r,findTsConfigSync as f}from"./packem_shared/findTsConfig-eQNXp6cy.js";import{configDirectoryPlaceholder as n,implicitBaseUrlSymbol as t,readTsConfig as c}from"./packem_shared/configDirectoryPlaceholder-BhSMyWHh.js";import{writeTsConfig as s,writeTsConfigSync as l}from"./packem_shared/writeTsConfig-
|
|
1
|
+
import{findTsConfig as r,findTsConfigSync as f}from"./packem_shared/findTsConfig-eQNXp6cy.js";import{configDirectoryPlaceholder as n,implicitBaseUrlSymbol as t,readTsConfig as c}from"./packem_shared/configDirectoryPlaceholder-BhSMyWHh.js";import{writeTsConfig as s,writeTsConfigSync as l}from"./packem_shared/writeTsConfig-CeJbHO7s.js";export{n as configDirectoryPlaceholder,r as findTsConfig,f as findTsConfigSync,t as implicitBaseUrlSymbol,c as readTsConfig,s as writeTsConfig,l as writeTsConfigSync};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{writeJson as d,writeJsonSync as l}from"@visulima/fs";import{toPath as p}from"@visulima/fs/utils";import{join as m}from"@visulima/path";const f={0:"es3",1:"es5",2:"es2015",3:"es2016",4:"es2017",5:"es2018",6:"es2019",7:"es2020",8:"es2021",9:"es2022",10:"es2023",11:"es2024",99:"esnext"},u={0:"none",1:"commonjs",2:"amd",3:"umd",4:"system",5:"es2015",6:"es2020",7:"es2022",99:"esnext",100:"node16",101:"node18",199:"nodenext",200:"preserve"},j={1:"classic",2:"node10",3:"node16",99:"nodenext",100:"bundler"},w={1:"preserve",2:"react-native",3:"react",4:"react-jsx",5:"react-jsxdev"},y={1:"legacy",2:"auto",3:"force"},x={0:"crlf",1:"lf"},v={jsx:w,module:u,moduleDetection:y,moduleResolution:j,newLine:x,target:f},O={7:new Set(["baseUrl","charset","importsNotUsedAsValues","keyofStringsOnly","noImplicitUseStrict","noStrictGenericChecks","out","prepend","preserveValueImports","suppressExcessPropertyErrors","suppressImplicitAnyIndexErrors"])},g=e=>{if(e===void 0)return;let s;for(const[r,o]of Object.entries(O))e>=Number(r)&&(s=s?new Set([...s,...o]):o);return s},S=(e,s={})=>{const r=g(s.removedForMajor),o={...e};for(const[t,n]of Object.entries(e)){if(r?.has(t)){delete o[t];continue}const c=v[t];if(c&&typeof n=="number"){const i=c[n];i===void 0?delete o[t]:o[t]=i}}return o},a=(e,s)=>e.compilerOptions?{...e,compilerOptions:S(e.compilerOptions,{removedForMajor:s})}:e,E=async(e,s={})=>{const{cwd:r,fileName:o="tsconfig.json",typescriptMajor:t,...n}=s,c=p(r??process.cwd());await d(m(c,o),a(e,t),n)},I=(e,s={})=>{const{cwd:r,fileName:o="tsconfig.json",typescriptMajor:t,...n}=s,c=p(r??process.cwd());l(m(c,o),a(e,t),n)};export{E as writeTsConfig,I as writeTsConfigSync};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@visulima/tsconfig",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.2.1",
|
|
4
4
|
"description": "Find and/or parse the tsconfig.json file from a directory path.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"anolilab",
|
|
@@ -52,7 +52,7 @@
|
|
|
52
52
|
"provenance": true
|
|
53
53
|
},
|
|
54
54
|
"dependencies": {
|
|
55
|
-
"@visulima/fs": "5.0.
|
|
55
|
+
"@visulima/fs": "5.0.6",
|
|
56
56
|
"@visulima/path": "3.0.0",
|
|
57
57
|
"jsonc-parser": "^3.3.1",
|
|
58
58
|
"resolve-pkg-maps": "^1.0.0"
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{writeJson as w,writeJsonSync as e}from"@visulima/fs";import{toPath as c}from"@visulima/fs/utils";import{join as r}from"@visulima/path";const a=async(o,s={})=>{const{cwd:n,...t}=s,i=c(n??process.cwd());await w(r(i,"tsconfig.json"),o,t)},d=(o,s={})=>{const{cwd:n,...t}=s,i=c(n??process.cwd());e(r(i,"tsconfig.json"),o,t)};export{a as writeTsConfig,d as writeTsConfigSync};
|