@visulima/package 1.3.0 → 1.3.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,11 @@
1
+ ## @visulima/package [1.3.1](https://github.com/visulima/visulima/compare/@visulima/package@1.3.0...@visulima/package@1.3.1) (2024-03-16)
2
+
3
+
4
+
5
+ ### Dependencies
6
+
7
+ * **@visulima/fs:** upgraded to 1.7.1
8
+
1
9
  ## @visulima/package [1.3.0](https://github.com/visulima/visulima/compare/@visulima/package@1.2.10...@visulima/package@1.3.0) (2024-03-16)
2
10
 
3
11
 
@@ -7,4 +7,4 @@ var w=async i=>{let o=i===void 0?void 0:toPath(i),n=await getTsconfig(o,"tsconfi
7
7
 
8
8
  export { w as a, u as b };
9
9
  //# sourceMappingURL=out.js.map
10
- //# sourceMappingURL=chunk-S5VJNFXH.js.map
10
+ //# sourceMappingURL=chunk-QNXGZOH4.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/tsconfig.ts"],"names":["join","writeJson","toPath","getTsconfig","findTSConfig","cwd","searchPath","config","writeTSConfig","data","options","writeOptions","directory"],"mappings":"AAAA,OAAS,QAAAA,MAAY,YAGrB,OAAS,aAAAC,MAAiB,eAC1B,OAAS,UAAAC,MAAc,qBAEvB,OAAS,eAAAC,MAAmB,eAYrB,IAAMC,EAAe,MAAOC,GAAgD,CAC/E,IAAMC,EAAaD,IAAQ,OAAY,OAAYH,EAAOG,CAAG,EAIzDE,EAAS,MAAMJ,EAAYG,EAAY,eAAe,EAO1D,GALIC,IAAW,OAEXA,EAAS,MAAMJ,EAAYG,EAAY,eAAe,GAGtDC,IAAW,KACX,MAAM,IAAI,MAAM,uDAAuD,EAG3E,OAAOA,CACX,EAWaC,EAAgB,MAAOC,EAAoBC,EAAqD,CAAC,IAAqB,CAE/H,GAAM,CAAE,IAAAL,EAAK,GAAGM,CAAa,EAAID,EAE3BE,EAAYV,EAAOQ,EAAQ,KAAO,QAAQ,IAAI,CAAC,EAErD,MAAMT,EAAUD,EAAKY,EAAW,eAAe,EAAGH,EAAME,CAAY,CACxE","sourcesContent":["import { join } from \"node:path\";\n\nimport type { WriteJsonOptions } from \"@visulima/fs\";\nimport { writeJson } from \"@visulima/fs\";\nimport { toPath } from \"@visulima/fs/utils\";\nimport type { TsConfigJson, TsConfigResult } from \"get-tsconfig\";\nimport { getTsconfig } from \"get-tsconfig\";\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 (data: TsConfigJson, options: WriteJsonOptions & { cwd?: URL | string } = {}): Promise<void> => {\n \n const { cwd, ...writeOptions } = options;\n \n const directory = toPath(options.cwd ?? process.cwd());\n\n await writeJson(join(directory, \"tsconfig.json\"), data, writeOptions);\n};\n\nexport type { TsConfigJson, TsConfigJsonResolved, TsConfigResult } from \"get-tsconfig\";\n"]}
1
+ {"version":3,"sources":["../src/tsconfig.ts"],"names":["join","writeJson","toPath","getTsconfig","findTSConfig","cwd","searchPath","config","writeTSConfig","data","options","writeOptions","directory"],"mappings":"AAAA,OAAS,QAAAA,MAAY,YAGrB,OAAS,aAAAC,MAAiB,eAC1B,OAAS,UAAAC,MAAc,qBAEvB,OAAS,eAAAC,MAAmB,eAYrB,IAAMC,EAAe,MAAOC,GAAgD,CAC/E,IAAMC,EAAaD,IAAQ,OAAY,OAAYH,EAAOG,CAAG,EAIzDE,EAAS,MAAMJ,EAAYG,EAAY,eAAe,EAO1D,GALIC,IAAW,OAEXA,EAAS,MAAMJ,EAAYG,EAAY,eAAe,GAGtDC,IAAW,KACX,MAAM,IAAI,MAAM,uDAAuD,EAG3E,OAAOA,CACX,EAWaC,EAAgB,MAAOC,EAAoBC,EAAqD,CAAC,IAAqB,CAC/H,GAAM,CAAE,IAAAL,EAAK,GAAGM,CAAa,EAAID,EAE3BE,EAAYV,EAAOQ,EAAQ,KAAO,QAAQ,IAAI,CAAC,EAErD,MAAMT,EAAUD,EAAKY,EAAW,eAAe,EAAGH,EAAME,CAAY,CACxE","sourcesContent":["import { join } from \"node:path\";\n\nimport type { WriteJsonOptions } from \"@visulima/fs\";\nimport { writeJson } from \"@visulima/fs\";\nimport { toPath } from \"@visulima/fs/utils\";\nimport type { TsConfigJson, TsConfigResult } from \"get-tsconfig\";\nimport { getTsconfig } from \"get-tsconfig\";\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 (data: TsConfigJson, options: WriteJsonOptions & { cwd?: URL | string } = {}): Promise<void> => {\n const { cwd, ...writeOptions } = options;\n\n const directory = toPath(options.cwd ?? process.cwd());\n\n await writeJson(join(directory, \"tsconfig.json\"), data, writeOptions);\n};\n\nexport type { TsConfigJson, TsConfigJsonResolved, TsConfigResult } from \"get-tsconfig\";\n"]}
@@ -10,4 +10,4 @@ var l=async i=>{let o=i===void 0?void 0:utils.toPath(i),n=await getTsconfig.getT
10
10
  exports.a = l;
11
11
  exports.b = w;
12
12
  //# sourceMappingURL=out.js.map
13
- //# sourceMappingURL=chunk-YZ33M3FE.cjs.map
13
+ //# sourceMappingURL=chunk-WOH32CRU.cjs.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/tsconfig.ts"],"names":["join","writeJson","toPath","getTsconfig","findTSConfig","cwd","searchPath","config","writeTSConfig","data","options","writeOptions","directory"],"mappings":"AAAA,OAAS,QAAAA,MAAY,OAGrB,OAAS,aAAAC,MAAiB,eAC1B,OAAS,UAAAC,MAAc,qBAEvB,OAAS,eAAAC,MAAmB,eAYrB,IAAMC,EAAe,MAAOC,GAAgD,CAC/E,IAAMC,EAAaD,IAAQ,OAAY,OAAYH,EAAOG,CAAG,EAIzDE,EAAS,MAAMJ,EAAYG,EAAY,eAAe,EAO1D,GALIC,IAAW,OAEXA,EAAS,MAAMJ,EAAYG,EAAY,eAAe,GAGtDC,IAAW,KACX,MAAM,IAAI,MAAM,uDAAuD,EAG3E,OAAOA,CACX,EAWaC,EAAgB,MAAOC,EAAoBC,EAAqD,CAAC,IAAqB,CAE/H,GAAM,CAAE,IAAAL,EAAK,GAAGM,CAAa,EAAID,EAE3BE,EAAYV,EAAOQ,EAAQ,KAAO,QAAQ,IAAI,CAAC,EAErD,MAAMT,EAAUD,EAAKY,EAAW,eAAe,EAAGH,EAAME,CAAY,CACxE","sourcesContent":["import { join } from \"node:path\";\n\nimport type { WriteJsonOptions } from \"@visulima/fs\";\nimport { writeJson } from \"@visulima/fs\";\nimport { toPath } from \"@visulima/fs/utils\";\nimport type { TsConfigJson, TsConfigResult } from \"get-tsconfig\";\nimport { getTsconfig } from \"get-tsconfig\";\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 (data: TsConfigJson, options: WriteJsonOptions & { cwd?: URL | string } = {}): Promise<void> => {\n \n const { cwd, ...writeOptions } = options;\n \n const directory = toPath(options.cwd ?? process.cwd());\n\n await writeJson(join(directory, \"tsconfig.json\"), data, writeOptions);\n};\n\nexport type { TsConfigJson, TsConfigJsonResolved, TsConfigResult } from \"get-tsconfig\";\n"]}
1
+ {"version":3,"sources":["../src/tsconfig.ts"],"names":["join","writeJson","toPath","getTsconfig","findTSConfig","cwd","searchPath","config","writeTSConfig","data","options","writeOptions","directory"],"mappings":"AAAA,OAAS,QAAAA,MAAY,OAGrB,OAAS,aAAAC,MAAiB,eAC1B,OAAS,UAAAC,MAAc,qBAEvB,OAAS,eAAAC,MAAmB,eAYrB,IAAMC,EAAe,MAAOC,GAAgD,CAC/E,IAAMC,EAAaD,IAAQ,OAAY,OAAYH,EAAOG,CAAG,EAIzDE,EAAS,MAAMJ,EAAYG,EAAY,eAAe,EAO1D,GALIC,IAAW,OAEXA,EAAS,MAAMJ,EAAYG,EAAY,eAAe,GAGtDC,IAAW,KACX,MAAM,IAAI,MAAM,uDAAuD,EAG3E,OAAOA,CACX,EAWaC,EAAgB,MAAOC,EAAoBC,EAAqD,CAAC,IAAqB,CAC/H,GAAM,CAAE,IAAAL,EAAK,GAAGM,CAAa,EAAID,EAE3BE,EAAYV,EAAOQ,EAAQ,KAAO,QAAQ,IAAI,CAAC,EAErD,MAAMT,EAAUD,EAAKY,EAAW,eAAe,EAAGH,EAAME,CAAY,CACxE","sourcesContent":["import { join } from \"node:path\";\n\nimport type { WriteJsonOptions } from \"@visulima/fs\";\nimport { writeJson } from \"@visulima/fs\";\nimport { toPath } from \"@visulima/fs/utils\";\nimport type { TsConfigJson, TsConfigResult } from \"get-tsconfig\";\nimport { getTsconfig } from \"get-tsconfig\";\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 (data: TsConfigJson, options: WriteJsonOptions & { cwd?: URL | string } = {}): Promise<void> => {\n const { cwd, ...writeOptions } = options;\n\n const directory = toPath(options.cwd ?? process.cwd());\n\n await writeJson(join(directory, \"tsconfig.json\"), data, writeOptions);\n};\n\nexport type { TsConfigJson, TsConfigJsonResolved, TsConfigResult } from \"get-tsconfig\";\n"]}
package/dist/index.cjs CHANGED
@@ -4,7 +4,7 @@ var chunkWKLGTORJ_cjs = require('./chunk-WKLGTORJ.cjs');
4
4
  var chunkX65BTKB7_cjs = require('./chunk-X65BTKB7.cjs');
5
5
  var chunkKG4KEP7W_cjs = require('./chunk-KG4KEP7W.cjs');
6
6
  var chunk3BB7IH7P_cjs = require('./chunk-3BB7IH7P.cjs');
7
- var chunkYZ33M3FE_cjs = require('./chunk-YZ33M3FE.cjs');
7
+ var chunkWOH32CRU_cjs = require('./chunk-WOH32CRU.cjs');
8
8
 
9
9
 
10
10
 
@@ -54,11 +54,11 @@ Object.defineProperty(exports, 'writePackageJsonSync', {
54
54
  });
55
55
  Object.defineProperty(exports, 'findTSConfig', {
56
56
  enumerable: true,
57
- get: function () { return chunkYZ33M3FE_cjs.a; }
57
+ get: function () { return chunkWOH32CRU_cjs.a; }
58
58
  });
59
59
  Object.defineProperty(exports, 'writeTSConfig', {
60
60
  enumerable: true,
61
- get: function () { return chunkYZ33M3FE_cjs.b; }
61
+ get: function () { return chunkWOH32CRU_cjs.b; }
62
62
  });
63
63
  //# sourceMappingURL=out.js.map
64
64
  //# sourceMappingURL=index.cjs.map
package/dist/index.js CHANGED
@@ -2,6 +2,6 @@ export { a as findMonorepoRoot } from './chunk-JUT7NLYV.js';
2
2
  export { a as findPackageRoot } from './chunk-S35C7FTW.js';
3
3
  export { a as findLockFile, b as findPackageManager, c as getPackageManagerVersion, d as identifyInitiatingPackageManager } from './chunk-EVIAOYPI.js';
4
4
  export { a as findPackageJson, b as findPackageJsonSync, e as parsePackageJson, c as writePackageJson, d as writePackageJsonSync } from './chunk-OIPHYJAS.js';
5
- export { a as findTSConfig, b as writeTSConfig } from './chunk-S5VJNFXH.js';
5
+ export { a as findTSConfig, b as writeTSConfig } from './chunk-QNXGZOH4.js';
6
6
  //# sourceMappingURL=out.js.map
7
7
  //# sourceMappingURL=index.js.map
package/dist/tsconfig.cjs CHANGED
@@ -1,16 +1,16 @@
1
1
  'use strict';
2
2
 
3
- var chunkYZ33M3FE_cjs = require('./chunk-YZ33M3FE.cjs');
3
+ var chunkWOH32CRU_cjs = require('./chunk-WOH32CRU.cjs');
4
4
 
5
5
 
6
6
 
7
7
  Object.defineProperty(exports, 'findTSConfig', {
8
8
  enumerable: true,
9
- get: function () { return chunkYZ33M3FE_cjs.a; }
9
+ get: function () { return chunkWOH32CRU_cjs.a; }
10
10
  });
11
11
  Object.defineProperty(exports, 'writeTSConfig', {
12
12
  enumerable: true,
13
- get: function () { return chunkYZ33M3FE_cjs.b; }
13
+ get: function () { return chunkWOH32CRU_cjs.b; }
14
14
  });
15
15
  //# sourceMappingURL=out.js.map
16
16
  //# sourceMappingURL=tsconfig.cjs.map
package/dist/tsconfig.js CHANGED
@@ -1,3 +1,3 @@
1
- export { a as findTSConfig, b as writeTSConfig } from './chunk-S5VJNFXH.js';
1
+ export { a as findTSConfig, b as writeTSConfig } from './chunk-QNXGZOH4.js';
2
2
  //# sourceMappingURL=out.js.map
3
3
  //# sourceMappingURL=tsconfig.js.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@visulima/package",
3
- "version": "1.3.0",
3
+ "version": "1.3.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",
@@ -137,7 +137,7 @@
137
137
  "test:watch": "vitest"
138
138
  },
139
139
  "dependencies": {
140
- "@visulima/fs": "1.7.0",
140
+ "@visulima/fs": "1.7.1",
141
141
  "get-tsconfig": "^4.7.3",
142
142
  "normalize-package-data": "^6.0.0",
143
143
  "type-fest": "^4.12.0"
@@ -151,8 +151,8 @@
151
151
  "@rushstack/eslint-plugin-security": "^0.8.1",
152
152
  "@total-typescript/ts-reset": "^0.5.1",
153
153
  "@types/node": "18.18.14",
154
- "@vitest/coverage-v8": "^1.3.1",
155
- "@vitest/ui": "^1.3.1",
154
+ "@vitest/coverage-v8": "^1.4.0",
155
+ "@vitest/ui": "^1.4.0",
156
156
  "cnpm": "^9.4.0",
157
157
  "cross-env": "^7.0.3",
158
158
  "eslint": "^8.57.0",
@@ -161,18 +161,18 @@
161
161
  "eslint-plugin-import": "npm:eslint-plugin-i@^2.29.1",
162
162
  "eslint-plugin-mdx": "^3.1.5",
163
163
  "eslint-plugin-tsdoc": "^0.2.17",
164
- "eslint-plugin-vitest": "^0.3.25",
165
- "eslint-plugin-vitest-globals": "^1.4.0",
164
+ "eslint-plugin-vitest": "^0.3.26",
165
+ "eslint-plugin-vitest-globals": "^1.5.0",
166
166
  "execa": "^8.0.1",
167
167
  "npm": "^10.5.0",
168
168
  "prettier": "^3.2.5",
169
169
  "rimraf": "^5.0.5",
170
- "semantic-release": "^23.0.2",
170
+ "semantic-release": "^23.0.4",
171
171
  "sort-package-json": "^2.8.0",
172
172
  "tempy": "^3.1.0",
173
173
  "tsup": "^8.0.2",
174
174
  "typescript": "^5.4.2",
175
- "vitest": "^1.3.1",
175
+ "vitest": "^1.4.0",
176
176
  "which-pm-runs": "file:",
177
177
  "yarn": "^1.22.22"
178
178
  },