@visulima/package 1.1.0 → 1.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 +19 -0
- package/dist/chunk-QQJUJRI7.js +10 -0
- package/dist/chunk-QQJUJRI7.js.map +1 -0
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/tsconfig.d.ts +1 -1
- package/dist/tsconfig.js +1 -1
- package/package.json +9 -9
- package/dist/chunk-HN5TULBQ.js +0 -10
- package/dist/chunk-HN5TULBQ.js.map +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,22 @@
|
|
|
1
|
+
## @visulima/package [1.2.1](https://github.com/visulima/visulima/compare/@visulima/package@1.2.0...@visulima/package@1.2.1) (2023-10-30)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Bug Fixes
|
|
5
|
+
|
|
6
|
+
* update dependencies in pnpm-lock.yaml ([d3a5626](https://github.com/visulima/visulima/commit/d3a5626d2c751c3e14f592db62b583b28046dcc7))
|
|
7
|
+
|
|
8
|
+
## @visulima/package [1.2.0](https://github.com/visulima/visulima/compare/@visulima/package@1.1.0...@visulima/package@1.2.0) (2023-10-24)
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
### Features
|
|
12
|
+
|
|
13
|
+
* extended findTSConfig with jsconfig.json search ([13902fd](https://github.com/visulima/visulima/commit/13902fdc8d3e08719ad52dd89fcc183d9bd9d042))
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
### Bug Fixes
|
|
17
|
+
|
|
18
|
+
* updated deps ([4eedb60](https://github.com/visulima/visulima/commit/4eedb604c4f78cf331195e2c053dc72e1c6cf9ad))
|
|
19
|
+
|
|
1
20
|
## @visulima/package [1.1.0](https://github.com/visulima/visulima/compare/@visulima/package@1.0.0...@visulima/package@1.1.0) (2023-10-17)
|
|
2
21
|
|
|
3
22
|
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { a, b } from './chunk-C7FQQQI6.js';
|
|
2
|
+
import { mkdir } from 'fs/promises';
|
|
3
|
+
import { join } from 'path';
|
|
4
|
+
import { getTsconfig } from 'get-tsconfig';
|
|
5
|
+
|
|
6
|
+
var w=async t=>{let i=t===void 0?void 0:a(t),o=await getTsconfig(i,"tsconfig.json");if(o===null&&(o=await getTsconfig(i,"jsconfig.json")),o===null)throw new Error("Could not find a tsconfig.json or jsconfig.json file.");return o},C=async(t,i={})=>{let o=a(i.cwd??process.cwd()),e=join(o,"tsconfig.json");await mkdir(o,{recursive:!0}),await b(e,t,i);};
|
|
7
|
+
|
|
8
|
+
export { w as a, C as b };
|
|
9
|
+
//# sourceMappingURL=out.js.map
|
|
10
|
+
//# sourceMappingURL=chunk-QQJUJRI7.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/tsconfig.ts"],"names":["mkdir","join","getTsconfig","findTSConfig","cwd","searchPath","to_path_default","config","writeTSConfig","tsConfig","options","directory","path","writeJsonFile"],"mappings":"+CAAA,OAAS,SAAAA,MAAa,cACtB,OAAS,QAAAC,MAAY,OAGrB,OAAS,eAAAC,MAAmB,eAgBrB,IAAMC,EAAe,MAAOC,GAAgD,CAC/E,IAAMC,EAAaD,IAAQ,OAAY,OAAYE,EAAOF,CAAG,EAIzDG,EAAS,MAAML,EAAYG,EAAY,eAAe,EAO1D,GALIE,IAAW,OAEXA,EAAS,MAAML,EAAYG,EAAY,eAAe,GAGtDE,IAAW,KACX,MAAM,IAAI,MAAM,uDAAuD,EAG3E,OAAOA,CACX,EAWaC,EAAgB,MAAOC,EAAwBC,EAAiD,CAAC,IAAqB,CAC/H,IAAMC,EAAYL,EAAOI,EAAQ,KAAO,QAAQ,IAAI,CAAC,EAC/CE,EAAOX,EAAKU,EAAW,eAAe,EAG5C,MAAMX,EAAMW,EAAW,CAAE,UAAW,EAAK,CAAC,EAE1C,MAAME,EAAcD,EAAMH,EAAUC,CAAO,CAC/C","sourcesContent":["import { mkdir } from \"node:fs/promises\";\nimport { join } from \"node:path\";\n\nimport type { TsConfigJson, TsConfigResult } from \"get-tsconfig\";\nimport { getTsconfig } from \"get-tsconfig\";\n\nimport toPath from \"./utils/to-path\";\nimport type { WriteOptions } from \"./utils/write-json\";\nimport { writeJsonFile } from \"./utils/write-json\";\n\n/**\n * An asynchronous function that retrieves the TSConfig by searching for the \"tsconfig.json\" first,\n * second attempt is to look for the \"jsconfig.json\" file from a given current working directory.\n *\n * @param cwd - Optional. The current working directory from which to search for the \"tsconfig.json\" file.\n * The type of `cwd` is `string`.\n * @returns A `Promise` that resolves to the TSConfig result object.\n * The return type of the function is `Promise<TsConfigResult>`.\n * @throws An `Error` when the \"tsconfig.json\" file is not found.\n */\nexport const findTSConfig = async (cwd?: URL | string): Promise<TsConfigResult> => {\n const searchPath = cwd === undefined ? undefined : toPath(cwd);\n\n // wrong typing in get-tsconfig\n // eslint-disable-next-line @typescript-eslint/await-thenable\n let config = await getTsconfig(searchPath, \"tsconfig.json\");\n\n if (config === null) {\n // eslint-disable-next-line @typescript-eslint/await-thenable\n config = await getTsconfig(searchPath, \"jsconfig.json\");\n }\n\n if (config === null) {\n throw new Error(\"Could not find a tsconfig.json or jsconfig.json file.\");\n }\n\n return config;\n};\n\n/**\n * An asynchronous function that writes the provided TypeScript configuration object to a tsconfig.json file.\n *\n * @param tsConfig - The TypeScript configuration object to write. The type of `tsConfig` is `TsConfigJson`.\n * @param options - Optional. The write options and the current working directory. The type of `options` is an\n * intersection type of `WriteOptions` and a Record type with an optional `cwd` key of type `string`.\n * @returns A `Promise` that resolves when the tsconfig.json file has been written.\n * The return type of function is `Promise<void>`.\n */\nexport const writeTSConfig = async (tsConfig: TsConfigJson, options: WriteOptions & { cwd?: URL | string } = {}): Promise<void> => {\n const directory = toPath(options.cwd ?? process.cwd());\n const path = join(directory, \"tsconfig.json\");\n\n // eslint-disable-next-line security/detect-non-literal-fs-filename\n await mkdir(directory, { recursive: true });\n\n await writeJsonFile(path, tsConfig, options);\n};\n\nexport type { TsConfigJson, TsConfigJsonResolved, TsConfigResult } from \"get-tsconfig\";\n"]}
|
package/dist/index.d.ts
CHANGED
|
@@ -4,6 +4,6 @@ export { NormalizedReadResult, findPackageJson, writePackageJson } from './packa
|
|
|
4
4
|
export { PackageManager, PackageManagerResult, findLockFile, findPackageManager, getPackageManagerVersion, identifyInitiatingPackageManager } from './package-manager.js';
|
|
5
5
|
export { findTSConfig, writeTSConfig } from './tsconfig.js';
|
|
6
6
|
export { NormalizedPackageJson, parsePackage as parsePackageJson } from 'read-pkg';
|
|
7
|
-
export { TsConfigJson, TsConfigJsonResolved } from 'get-tsconfig';
|
|
7
|
+
export { TsConfigJson, TsConfigJsonResolved, TsConfigResult } from 'get-tsconfig';
|
|
8
8
|
import 'find-up';
|
|
9
9
|
import './write-json-7d6e6751.js';
|
package/dist/index.js
CHANGED
|
@@ -2,7 +2,7 @@ export { a as findMonorepoRoot } from './chunk-T4PCL5Z7.js';
|
|
|
2
2
|
export { a as findPackageRoot } from './chunk-7WLQPGXB.js';
|
|
3
3
|
export { a as findPackageJson, c as parsePackageJson, b as writePackageJson } from './chunk-7TF75EA4.js';
|
|
4
4
|
export { a as findLockFile, b as findPackageManager, c as getPackageManagerVersion, d as identifyInitiatingPackageManager } from './chunk-IWQKH4TN.js';
|
|
5
|
-
export { a as findTSConfig, b as writeTSConfig } from './chunk-
|
|
5
|
+
export { a as findTSConfig, b as writeTSConfig } from './chunk-QQJUJRI7.js';
|
|
6
6
|
import './chunk-C7FQQQI6.js';
|
|
7
7
|
//# sourceMappingURL=out.js.map
|
|
8
8
|
//# sourceMappingURL=index.js.map
|
package/dist/tsconfig.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { TsConfigResult, TsConfigJson } from 'get-tsconfig';
|
|
2
|
-
export { TsConfigJson, TsConfigJsonResolved } from 'get-tsconfig';
|
|
2
|
+
export { TsConfigJson, TsConfigJsonResolved, TsConfigResult } from 'get-tsconfig';
|
|
3
3
|
import { W as WriteOptions } from './write-json-7d6e6751.js';
|
|
4
4
|
|
|
5
5
|
declare const findTSConfig: (cwd?: URL | string) => Promise<TsConfigResult>;
|
package/dist/tsconfig.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@visulima/package",
|
|
3
|
-
"version": "1.1
|
|
3
|
+
"version": "1.2.1",
|
|
4
4
|
"description": "One Package to rule them all, finds your root-dir, monorepo, package manager or tsconfig.json",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"anolilab",
|
|
@@ -122,23 +122,23 @@
|
|
|
122
122
|
"@anolilab/prettier-config": "^5.0.11",
|
|
123
123
|
"@anolilab/semantic-release-preset": "^8.0.0",
|
|
124
124
|
"@babel/core": "^7.23.2",
|
|
125
|
-
"@pnpm/exe": "^8.
|
|
125
|
+
"@pnpm/exe": "^8.10.0",
|
|
126
126
|
"@rushstack/eslint-plugin-security": "^0.7.1",
|
|
127
127
|
"@total-typescript/ts-reset": "^0.5.1",
|
|
128
128
|
"@types/node": "18.18.5",
|
|
129
129
|
"@vitest/coverage-v8": "^0.34.6",
|
|
130
|
-
"cnpm": "^
|
|
130
|
+
"cnpm": "^9.2.0",
|
|
131
131
|
"cross-env": "^7.0.3",
|
|
132
|
-
"eslint": "^8.
|
|
132
|
+
"eslint": "^8.52.0",
|
|
133
133
|
"eslint-plugin-deprecation": "^2.0.0",
|
|
134
134
|
"eslint-plugin-etc": "^2.0.3",
|
|
135
|
-
"eslint-plugin-import": "npm:eslint-plugin-i@^2.
|
|
135
|
+
"eslint-plugin-import": "npm:eslint-plugin-i@^2.29.0",
|
|
136
136
|
"eslint-plugin-mdx": "^2.2.0",
|
|
137
137
|
"eslint-plugin-tsdoc": "^0.2.17",
|
|
138
|
-
"eslint-plugin-vitest": "^0.3.
|
|
138
|
+
"eslint-plugin-vitest": "^0.3.8",
|
|
139
139
|
"eslint-plugin-vitest-globals": "^1.4.0",
|
|
140
|
-
"execa": "^
|
|
141
|
-
"npm": "^
|
|
140
|
+
"execa": "^8.0.1",
|
|
141
|
+
"npm": "^10.2.1",
|
|
142
142
|
"prettier": "^3.0.3",
|
|
143
143
|
"rimraf": "^5.0.5",
|
|
144
144
|
"semantic-release": "^22.0.5",
|
|
@@ -147,7 +147,7 @@
|
|
|
147
147
|
"typescript": "^5.2.2",
|
|
148
148
|
"vitest": "^0.34.6",
|
|
149
149
|
"which-pm-runs": "file:",
|
|
150
|
-
"yarn": "^1.22.
|
|
150
|
+
"yarn": "^1.22.19"
|
|
151
151
|
},
|
|
152
152
|
"engines": {
|
|
153
153
|
"node": ">=18.* <=20.*"
|
package/dist/chunk-HN5TULBQ.js
DELETED
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { a, b } from './chunk-C7FQQQI6.js';
|
|
2
|
-
import { mkdir } from 'fs/promises';
|
|
3
|
-
import { join } from 'path';
|
|
4
|
-
import { getTsconfig } from 'get-tsconfig';
|
|
5
|
-
|
|
6
|
-
var C=async t=>{let o=await getTsconfig(t===void 0?void 0:a(t),"tsconfig.json");if(o===null)throw new Error("Could not find tsconfig.json");return o},T=async(t,o={})=>{let n=a(o.cwd??process.cwd()),s=join(n,"tsconfig.json");await mkdir(n,{recursive:!0}),await b(s,t,o);};
|
|
7
|
-
|
|
8
|
-
export { C as a, T as b };
|
|
9
|
-
//# sourceMappingURL=out.js.map
|
|
10
|
-
//# sourceMappingURL=chunk-HN5TULBQ.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/tsconfig.ts"],"names":["mkdir","join","getTsconfig","findTSConfig","cwd","config","to_path_default","writeTSConfig","tsConfig","options","directory","path","writeJsonFile"],"mappings":"+CAAA,OAAS,SAAAA,MAAa,cACtB,OAAS,QAAAC,MAAY,OAGrB,OAAS,eAAAC,MAAmB,eAgBrB,IAAMC,EAAe,MAAOC,GAAgD,CAG/E,IAAMC,EAAS,MAAMH,EAAYE,IAAQ,OAAY,OAAYE,EAAOF,CAAG,EAAG,eAAe,EAE7F,GAAIC,IAAW,KACX,MAAM,IAAI,MAAM,8BAA8B,EAGlD,OAAOA,CACX,EAWaE,EAAgB,MAAOC,EAAwBC,EAAiD,CAAC,IAAqB,CAC/H,IAAMC,EAAYJ,EAAOG,EAAQ,KAAO,QAAQ,IAAI,CAAC,EAC/CE,EAAOV,EAAKS,EAAW,eAAe,EAG5C,MAAMV,EAAMU,EAAW,CAAE,UAAW,EAAK,CAAC,EAE1C,MAAME,EAAcD,EAAMH,EAAUC,CAAO,CAC/C","sourcesContent":["import { mkdir } from \"node:fs/promises\";\nimport { join } from \"node:path\";\n\nimport type { TsConfigJson, TsConfigResult } from \"get-tsconfig\";\nimport { getTsconfig } from \"get-tsconfig\";\n\nimport toPath from \"./utils/to-path\";\nimport type { WriteOptions } from \"./utils/write-json\";\nimport { writeJsonFile } from \"./utils/write-json\";\n\n/**\n * An asynchronous function that retrieves the TSConfig by searching for the \"tsconfig.json\" file from a given\n * current working directory.\n *\n * @param cwd - Optional. The current working directory from which to search for the \"tsconfig.json\" file.\n * The type of `cwd` is `string`.\n * @returns A `Promise` that resolves to the TSConfig result object.\n * The return type of the function is `Promise<TsConfigResult>`.\n * @throws An `Error` when the \"tsconfig.json\" file is not found.\n */\nexport const findTSConfig = async (cwd?: URL | string): Promise<TsConfigResult> => {\n // wrong typing in get-tsconfig\n // eslint-disable-next-line @typescript-eslint/await-thenable\n const config = await getTsconfig(cwd === undefined ? undefined : toPath(cwd), \"tsconfig.json\");\n\n if (config === null) {\n throw new Error(\"Could not find tsconfig.json\");\n }\n\n return config;\n};\n\n/**\n * An asynchronous function that writes the provided TypeScript configuration object to a tsconfig.json file.\n *\n * @param tsConfig - The TypeScript configuration object to write. The type of `tsConfig` is `TsConfigJson`.\n * @param options - Optional. The write options and the current working directory. The type of `options` is an\n * intersection type of `WriteOptions` and a Record type with an optional `cwd` key of type `string`.\n * @returns A `Promise` that resolves when the tsconfig.json file has been written.\n * The return type of function is `Promise<void>`.\n */\nexport const writeTSConfig = async (tsConfig: TsConfigJson, options: WriteOptions & { cwd?: URL | string } = {}): Promise<void> => {\n const directory = toPath(options.cwd ?? process.cwd());\n const path = join(directory, \"tsconfig.json\");\n\n // eslint-disable-next-line security/detect-non-literal-fs-filename\n await mkdir(directory, { recursive: true });\n\n await writeJsonFile(path, tsConfig, options);\n};\n\nexport type { TsConfigJson, TsConfigJsonResolved } from \"get-tsconfig\";\n"]}
|