@naturalcycles/nodejs-lib 14.0.1 → 14.1.0

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.
@@ -1,12 +1,12 @@
1
1
  #!/usr/bin/env node
2
2
  import fs from 'node:fs';
3
3
  import path from 'node:path';
4
- import yargs from 'yargs';
5
4
  import { appendToBashEnv, appendToGithubEnv, appendToGithubOutput } from '../fs/json2env.js';
6
5
  import { runScript } from '../script/runScript.js';
7
6
  import { generateBuildInfo } from '../util/buildInfo.util.js';
7
+ import { _yargs } from '../yargs.util.js';
8
8
  runScript(async () => {
9
- const { dir, overrideTimestamp } = yargs.options({
9
+ const { dir, overrideTimestamp } = _yargs().options({
10
10
  dir: {
11
11
  type: 'string',
12
12
  desc: 'Output directory',
@@ -1,9 +1,11 @@
1
1
  #!/usr/bin/env node
2
- import yargs from 'yargs';
3
2
  import { json2env } from '../fs/json2env.js';
4
3
  import { runScript } from '../script/runScript.js';
4
+ import { _yargs } from '../yargs.util.js';
5
5
  runScript(() => {
6
- const { argv } = yargs.demandCommand(1).options({
6
+ const { argv } = _yargs()
7
+ .demandCommand(1)
8
+ .options({
7
9
  prefix: {
8
10
  type: 'string',
9
11
  },
package/dist/bin/kpy.js CHANGED
@@ -1,9 +1,11 @@
1
1
  #!/usr/bin/env node
2
- import yargs from 'yargs';
3
2
  import { kpySync } from '../fs/kpy.js';
4
3
  import { runScript } from '../script/runScript.js';
4
+ import { _yargs } from '../yargs.util.js';
5
5
  runScript(() => {
6
- const { _: [baseDir, ...inputPatterns], ...opt } = yargs.demandCommand(2).options({
6
+ const { _: [baseDir, ...inputPatterns], ...opt } = _yargs()
7
+ .demandCommand(2)
8
+ .options({
7
9
  silent: {
8
10
  type: 'boolean',
9
11
  desc: 'Suppress all text output',
@@ -1,10 +1,10 @@
1
1
  #!/usr/bin/env node
2
2
  import { randomBytes } from 'node:crypto';
3
- import yargs from 'yargs';
4
3
  import { dimGrey } from '../colors/colors.js';
5
4
  import { runScript } from '../script/runScript.js';
5
+ import { _yargs } from '../yargs.util.js';
6
6
  runScript(() => {
7
- const { sizeBytes } = yargs.option('sizeBytes', {
7
+ const { sizeBytes } = _yargs().option('sizeBytes', {
8
8
  type: 'number',
9
9
  default: 256,
10
10
  }).argv;
@@ -1,9 +1,8 @@
1
1
  #!/usr/bin/env node
2
- import yargs from 'yargs';
3
- import { SlackService } from '../index.js';
2
+ import { _yargs, SlackService } from '../index.js';
4
3
  import { runScript } from '../script/runScript.js';
5
4
  runScript(async () => {
6
- const { channel, msg, username, emoji, webhook: webhookUrl, } = yargs.options({
5
+ const { channel, msg, username, emoji, webhook: webhookUrl, } = _yargs().options({
7
6
  channel: {
8
7
  type: 'string',
9
8
  demandOption: true,
package/dist/fs/kpy.js CHANGED
@@ -1,11 +1,12 @@
1
1
  import path from 'node:path';
2
2
  import { _since, localTime } from '@naturalcycles/js-lib';
3
+ import { glob, globSync } from 'tinyglobby';
3
4
  import { boldWhite, dimGrey, grey, yellow } from '../colors/colors.js';
4
- import { fastGlob, fs2 } from '../index.js';
5
+ import { fs2 } from './fs2.js';
5
6
  export async function kpy(opt) {
6
7
  const started = localTime.nowUnixMillis();
7
8
  kpyPrepare(opt);
8
- const filenames = await fastGlob(opt.inputPatterns, {
9
+ const filenames = await glob(opt.inputPatterns, {
9
10
  cwd: opt.baseDir,
10
11
  dot: opt.dotfiles,
11
12
  });
@@ -34,7 +35,7 @@ export async function kpy(opt) {
34
35
  export function kpySync(opt) {
35
36
  const started = localTime.nowUnixMillis();
36
37
  kpyPrepare(opt);
37
- const filenames = fastGlob.sync(opt.inputPatterns, {
38
+ const filenames = globSync(opt.inputPatterns, {
38
39
  cwd: opt.baseDir,
39
40
  dot: opt.dotfiles,
40
41
  });
package/dist/index.d.ts CHANGED
@@ -1,6 +1,5 @@
1
1
  import Ajv from 'ajv';
2
- import type { Options as FastGlobOptions } from 'fast-glob';
3
- import fastGlob from 'fast-glob';
2
+ export { glob, globSync } from 'tinyglobby';
4
3
  import type { AlternativesSchema, AnySchema, ArraySchema, BinarySchema, BooleanSchema, DateSchema, FunctionSchema, ObjectSchema, ValidationErrorItem } from 'joi';
5
4
  export * from './buffer/buffer.util.js';
6
5
  export * from './colors/colors.js';
@@ -73,5 +72,5 @@ export * from './validation/joi/joi.validation.error.js';
73
72
  export * from './validation/joi/joi.validation.util.js';
74
73
  export type { StringSchema } from './validation/joi/string.extensions.js';
75
74
  export * from './yargs.util.js';
76
- export type { AlternativesSchema, AnySchema, ArraySchema, BinarySchema, BooleanSchema, DateSchema, FastGlobOptions, FunctionSchema, ObjectSchema, ValidationErrorItem, };
77
- export { Ajv, fastGlob };
75
+ export type { AlternativesSchema, AnySchema, ArraySchema, BinarySchema, BooleanSchema, DateSchema, FunctionSchema, ObjectSchema, ValidationErrorItem, };
76
+ export { Ajv };
package/dist/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import Ajv from 'ajv';
2
- import fastGlob from 'fast-glob';
2
+ export { glob, globSync } from 'tinyglobby';
3
3
  export * from './buffer/buffer.util.js';
4
4
  export * from './colors/colors.js';
5
5
  export * from './csv/csvReader.js';
@@ -70,4 +70,4 @@ export * from './validation/joi/joi.shared.schemas.js';
70
70
  export * from './validation/joi/joi.validation.error.js';
71
71
  export * from './validation/joi/joi.validation.util.js';
72
72
  export * from './yargs.util.js';
73
- export { Ajv, fastGlob };
73
+ export { Ajv };
@@ -1,5 +1,5 @@
1
1
  import { commonLoggerCreate } from '@naturalcycles/js-lib';
2
- import { _inspect } from '../index.js';
2
+ import { _inspect } from '../string/inspect.js';
3
3
  /**
4
4
  * CommonLogger that logs to process.stdout directly (bypassing console.log).
5
5
  */
@@ -1,8 +1,9 @@
1
1
  import fs from 'node:fs';
2
2
  import path from 'node:path';
3
3
  import { _assert } from '@naturalcycles/js-lib';
4
+ import { globSync } from 'tinyglobby';
4
5
  import { dimGrey, yellow } from '../colors/colors.js';
5
- import { fastGlob, fs2 } from '../index.js';
6
+ import { fs2 } from '../fs/fs2.js';
6
7
  import { decryptObject, decryptRandomIVBuffer } from '../security/crypto.util.js';
7
8
  // Debug it like this:
8
9
  // yarn tsx scripts/./src/bin/secrets-encrypt.ts --file ./src/test/secrets2.plain.json --jsonMode --encKey MPd/30v0Zcce4I5mfwF4NSXrpTYD9OO4/fIqw6rjNiWp2b1GN9Xm8nQZqr7c9kKSsATqtwe0HkJFDUGzDSow44GDgDICgB1u1rGa5eNqtxnOVGRR+lIinCvN/1OnpjzeoJy2bStXPj1DKx8anMqgA8SoOZdlWRNSkEeZlolru8Ey0ujZo22dfwMyRIEniLcqvBm/iMiAkV82fn/TxYw05GarAoJcrfPeDBvuOXsARnMCyX18qTFL0iojxeTU8JHxr8TX3eXDq9cJJmridEKlwRIAzADwtetI4ttlP8lwJj1pmgsBIN3iqYssZYCkZ3HMV6BoEc7LTI5z/45rKrAT1A==
@@ -16,7 +17,7 @@ import { decryptObject, decryptRandomIVBuffer } from '../security/crypto.util.js
16
17
  export function secretsDecrypt(dir, file, encKeyBuffer, del = false, jsonMode = false) {
17
18
  // If `file` is provided - only this one file is used
18
19
  const patterns = file ? [file] : dir.map(d => `${d}/**/*.enc`);
19
- const filenames = fastGlob.sync(patterns);
20
+ const filenames = globSync(patterns);
20
21
  filenames.forEach(filename => {
21
22
  let plainFilename;
22
23
  if (jsonMode) {
@@ -1,8 +1,9 @@
1
1
  import fs from 'node:fs';
2
2
  import path from 'node:path';
3
3
  import { _assert } from '@naturalcycles/js-lib';
4
+ import { globSync } from 'tinyglobby';
4
5
  import { dimGrey, yellow } from '../colors/colors.js';
5
- import { fastGlob, fs2 } from '../index.js';
6
+ import { fs2 } from '../fs/fs2.js';
6
7
  import { encryptObject, encryptRandomIVBuffer } from '../security/crypto.util.js';
7
8
  /**
8
9
  * Encrypts all files in given directory (except *.enc), saves encrypted versions as filename.ext.enc.
@@ -15,7 +16,7 @@ export function secretsEncrypt(pattern, file, encKeyBuffer, del = false, jsonMod
15
16
  ...pattern,
16
17
  `!**/*.enc`, // excluding already encoded
17
18
  ];
18
- const filenames = fastGlob.sync(patterns);
19
+ const filenames = globSync(patterns);
19
20
  let encFilename;
20
21
  filenames.forEach(filename => {
21
22
  if (jsonMode) {
@@ -1,5 +1,5 @@
1
1
  import type { JsonSchema } from '@naturalcycles/js-lib';
2
- import type { FastGlobOptions } from '../../index.js';
2
+ import type { GlobOptions } from 'tinyglobby';
3
3
  import type { AjvSchemaCfg } from './ajvSchema.js';
4
4
  import { AjvSchema } from './ajvSchema.js';
5
5
  /**
@@ -10,7 +10,7 @@ import { AjvSchema } from './ajvSchema.js';
10
10
  *
11
11
  * @experimental
12
12
  */
13
- export declare function readJsonSchemas(patterns: string | string[], opt?: FastGlobOptions): JsonSchema[];
13
+ export declare function readJsonSchemas(patterns: string | string[], opt?: Omit<GlobOptions, 'patterns'>): JsonSchema[];
14
14
  /**
15
15
  * Reads json schemas from given dir (glob pattern).
16
16
  * Creates new AjvSchema for each of them (ajv validates them upon creation).
@@ -1,4 +1,5 @@
1
- import { fastGlob, fs2 } from '../../index.js';
1
+ import { globSync } from 'tinyglobby';
2
+ import { fs2 } from '../../fs/fs2.js';
2
3
  import { AjvSchema } from './ajvSchema.js';
3
4
  /**
4
5
  * Does fs.readFileSync + JSON.parse for ALL files matching the passed `glob` pattern.
@@ -9,7 +10,7 @@ import { AjvSchema } from './ajvSchema.js';
9
10
  * @experimental
10
11
  */
11
12
  export function readJsonSchemas(patterns, opt) {
12
- return fastGlob.sync(patterns, opt).map(fileName => fs2.readJson(fileName));
13
+ return globSync(patterns, opt).map(fileName => fs2.readJson(fileName));
13
14
  }
14
15
  /**
15
16
  * Reads json schemas from given dir (glob pattern).
@@ -1,5 +1,7 @@
1
1
  import { _filterNullishValues, _isObject, _substringBefore, JsonSchemaAnyBuilder, } from '@naturalcycles/js-lib';
2
- import { _inspect, fs2, requireFileToExist } from '../../index.js';
2
+ import { fs2 } from '../../fs/fs2.js';
3
+ import { _inspect } from '../../string/inspect.js';
4
+ import { requireFileToExist } from '../../util/env.util.js';
3
5
  import { AjvValidationError } from './ajvValidationError.js';
4
6
  import { getAjv } from './getAjv.js';
5
7
  /**
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@naturalcycles/nodejs-lib",
3
3
  "type": "module",
4
- "version": "14.0.1",
4
+ "version": "14.1.0",
5
5
  "scripts": {
6
6
  "prepare": "husky",
7
7
  "build": "dev-lib build",
@@ -30,12 +30,12 @@
30
30
  "ajv-keywords": "^5",
31
31
  "chalk": "^5",
32
32
  "dotenv": "^16",
33
- "fast-glob": "^3",
34
33
  "joi": "^17",
35
34
  "js-yaml": "^4",
36
35
  "jsonwebtoken": "^9",
37
36
  "lru-cache": "^11",
38
37
  "through2-concurrent": "^2",
38
+ "tinyglobby": "^0.2",
39
39
  "yargs": "^17"
40
40
  },
41
41
  "devDependencies": {
@@ -43,7 +43,6 @@
43
43
  "@naturalcycles/dev-lib": "^18",
44
44
  "@types/node": "^22",
45
45
  "@types/through2-concurrent": "^2",
46
- "@vitest/coverage-v8": "^3",
47
46
  "tsx": "^4",
48
47
  "vitest": "^3"
49
48
  },
@@ -3,13 +3,13 @@
3
3
  import fs from 'node:fs'
4
4
  import path from 'node:path'
5
5
  import type { UnixTimestamp } from '@naturalcycles/js-lib'
6
- import yargs from 'yargs'
7
6
  import { appendToBashEnv, appendToGithubEnv, appendToGithubOutput } from '../fs/json2env.js'
8
7
  import { runScript } from '../script/runScript.js'
9
8
  import { generateBuildInfo } from '../util/buildInfo.util.js'
9
+ import { _yargs } from '../yargs.util.js'
10
10
 
11
11
  runScript(async () => {
12
- const { dir, overrideTimestamp } = yargs.options({
12
+ const { dir, overrideTimestamp } = _yargs().options({
13
13
  dir: {
14
14
  type: 'string',
15
15
  desc: 'Output directory',
@@ -1,41 +1,43 @@
1
1
  #!/usr/bin/env node
2
2
 
3
- import yargs from 'yargs'
4
3
  import { json2env } from '../fs/json2env.js'
5
4
  import { runScript } from '../script/runScript.js'
5
+ import { _yargs } from '../yargs.util.js'
6
6
 
7
7
  runScript(() => {
8
- const { argv } = yargs.demandCommand(1).options({
9
- prefix: {
10
- type: 'string',
11
- },
12
- saveEnvFile: {
13
- type: 'boolean',
14
- desc: 'Save $JSON_FILE_NAME.sh file that exports json vars as environment vars',
15
- default: true,
16
- },
17
- bashEnv: {
18
- type: 'boolean',
19
- desc: 'Populate $BASH_ENV file if BASH_ENV env variable exists',
20
- default: true,
21
- },
22
- githubEnv: {
23
- type: 'boolean',
24
- desc: 'Populate $GITHUB_ENV file if GITHUB_ENV env variable exists',
25
- default: true,
26
- },
27
- fail: {
28
- type: 'boolean',
29
- desc: 'Fail (exit status 1) on non-existing input file',
30
- default: true,
31
- },
32
- debug: {
33
- type: 'boolean',
34
- },
35
- silent: {
36
- type: 'boolean',
37
- },
38
- })
8
+ const { argv } = _yargs()
9
+ .demandCommand(1)
10
+ .options({
11
+ prefix: {
12
+ type: 'string',
13
+ },
14
+ saveEnvFile: {
15
+ type: 'boolean',
16
+ desc: 'Save $JSON_FILE_NAME.sh file that exports json vars as environment vars',
17
+ default: true,
18
+ },
19
+ bashEnv: {
20
+ type: 'boolean',
21
+ desc: 'Populate $BASH_ENV file if BASH_ENV env variable exists',
22
+ default: true,
23
+ },
24
+ githubEnv: {
25
+ type: 'boolean',
26
+ desc: 'Populate $GITHUB_ENV file if GITHUB_ENV env variable exists',
27
+ default: true,
28
+ },
29
+ fail: {
30
+ type: 'boolean',
31
+ desc: 'Fail (exit status 1) on non-existing input file',
32
+ default: true,
33
+ },
34
+ debug: {
35
+ type: 'boolean',
36
+ },
37
+ silent: {
38
+ type: 'boolean',
39
+ },
40
+ })
39
41
 
40
42
  const { _: args, prefix, saveEnvFile, bashEnv, githubEnv, fail, debug, silent } = argv
41
43
  if (debug) console.log({ argv })
package/src/bin/kpy.ts CHANGED
@@ -1,40 +1,42 @@
1
1
  #!/usr/bin/env node
2
2
 
3
- import yargs from 'yargs'
4
3
  import { kpySync } from '../fs/kpy.js'
5
4
  import { runScript } from '../script/runScript.js'
5
+ import { _yargs } from '../yargs.util.js'
6
6
 
7
7
  runScript(() => {
8
8
  const {
9
9
  _: [baseDir, ...inputPatterns],
10
10
  ...opt
11
- } = yargs.demandCommand(2).options({
12
- silent: {
13
- type: 'boolean',
14
- desc: 'Suppress all text output',
15
- },
16
- verbose: {
17
- type: 'boolean',
18
- desc: 'Report progress on every file',
19
- },
20
- overwrite: {
21
- type: 'boolean',
22
- default: true,
23
- },
24
- dotfiles: {
25
- type: 'boolean',
26
- },
27
- flat: {
28
- type: 'boolean',
29
- },
30
- dry: {
31
- type: 'boolean',
32
- },
33
- move: {
34
- type: 'boolean',
35
- descr: 'Move files instead of copy',
36
- },
37
- }).argv
11
+ } = _yargs()
12
+ .demandCommand(2)
13
+ .options({
14
+ silent: {
15
+ type: 'boolean',
16
+ desc: 'Suppress all text output',
17
+ },
18
+ verbose: {
19
+ type: 'boolean',
20
+ desc: 'Report progress on every file',
21
+ },
22
+ overwrite: {
23
+ type: 'boolean',
24
+ default: true,
25
+ },
26
+ dotfiles: {
27
+ type: 'boolean',
28
+ },
29
+ flat: {
30
+ type: 'boolean',
31
+ },
32
+ dry: {
33
+ type: 'boolean',
34
+ },
35
+ move: {
36
+ type: 'boolean',
37
+ descr: 'Move files instead of copy',
38
+ },
39
+ }).argv
38
40
 
39
41
  const outputDir = inputPatterns.pop() as string
40
42
 
@@ -1,12 +1,12 @@
1
1
  #!/usr/bin/env node
2
2
 
3
3
  import { randomBytes } from 'node:crypto'
4
- import yargs from 'yargs'
5
4
  import { dimGrey } from '../colors/colors.js'
6
5
  import { runScript } from '../script/runScript.js'
6
+ import { _yargs } from '../yargs.util.js'
7
7
 
8
8
  runScript(() => {
9
- const { sizeBytes } = yargs.option('sizeBytes', {
9
+ const { sizeBytes } = _yargs().option('sizeBytes', {
10
10
  type: 'number',
11
11
  default: 256,
12
12
  }).argv
@@ -1,7 +1,6 @@
1
1
  #!/usr/bin/env node
2
2
 
3
- import yargs from 'yargs'
4
- import { SlackService } from '../index.js'
3
+ import { _yargs, SlackService } from '../index.js'
5
4
  import { runScript } from '../script/runScript.js'
6
5
 
7
6
  runScript(async () => {
@@ -11,7 +10,7 @@ runScript(async () => {
11
10
  username,
12
11
  emoji,
13
12
  webhook: webhookUrl,
14
- } = yargs.options({
13
+ } = _yargs().options({
15
14
  channel: {
16
15
  type: 'string',
17
16
  demandOption: true,
package/src/fs/kpy.ts CHANGED
@@ -1,8 +1,9 @@
1
1
  import path from 'node:path'
2
2
  import type { UnixTimestampMillis } from '@naturalcycles/js-lib'
3
3
  import { _since, localTime } from '@naturalcycles/js-lib'
4
+ import { glob, globSync } from 'tinyglobby'
4
5
  import { boldWhite, dimGrey, grey, yellow } from '../colors/colors.js'
5
- import { fastGlob, fs2 } from '../index.js'
6
+ import { fs2 } from './fs2.js'
6
7
 
7
8
  /**
8
9
  * Everything defaults to `undefined`.
@@ -48,7 +49,7 @@ export async function kpy(opt: KpyOptions): Promise<void> {
48
49
 
49
50
  kpyPrepare(opt)
50
51
 
51
- const filenames = await fastGlob(opt.inputPatterns!, {
52
+ const filenames = await glob(opt.inputPatterns!, {
52
53
  cwd: opt.baseDir,
53
54
  dot: opt.dotfiles,
54
55
  })
@@ -87,7 +88,7 @@ export function kpySync(opt: KpyOptions): void {
87
88
 
88
89
  kpyPrepare(opt)
89
90
 
90
- const filenames = fastGlob.sync(opt.inputPatterns!, {
91
+ const filenames = globSync(opt.inputPatterns!, {
91
92
  cwd: opt.baseDir,
92
93
  dot: opt.dotfiles,
93
94
  })
package/src/index.ts CHANGED
@@ -1,6 +1,5 @@
1
1
  import Ajv from 'ajv'
2
- import type { Options as FastGlobOptions } from 'fast-glob'
3
- import fastGlob from 'fast-glob'
2
+ export { glob, globSync } from 'tinyglobby'
4
3
  import type {
5
4
  AlternativesSchema,
6
5
  AnySchema,
@@ -91,7 +90,6 @@ export type {
91
90
  BinarySchema,
92
91
  BooleanSchema,
93
92
  DateSchema,
94
- FastGlobOptions,
95
93
  FunctionSchema,
96
94
  ObjectSchema,
97
95
  ValidationErrorItem,
@@ -100,4 +98,4 @@ export type {
100
98
  // StringSchema,
101
99
  }
102
100
 
103
- export { Ajv, fastGlob }
101
+ export { Ajv }
@@ -1,5 +1,5 @@
1
1
  import { commonLoggerCreate } from '@naturalcycles/js-lib'
2
- import { _inspect } from '../index.js'
2
+ import { _inspect } from '../string/inspect.js'
3
3
 
4
4
  /**
5
5
  * CommonLogger that logs to process.stdout directly (bypassing console.log).
@@ -1,8 +1,9 @@
1
1
  import fs from 'node:fs'
2
2
  import path from 'node:path'
3
3
  import { _assert } from '@naturalcycles/js-lib'
4
+ import { globSync } from 'tinyglobby'
4
5
  import { dimGrey, yellow } from '../colors/colors.js'
5
- import { fastGlob, fs2 } from '../index.js'
6
+ import { fs2 } from '../fs/fs2.js'
6
7
  import { decryptObject, decryptRandomIVBuffer } from '../security/crypto.util.js'
7
8
 
8
9
  export interface DecryptCLIOptions {
@@ -34,7 +35,7 @@ export function secretsDecrypt(
34
35
  // If `file` is provided - only this one file is used
35
36
  const patterns = file ? [file] : dir.map(d => `${d}/**/*.enc`)
36
37
 
37
- const filenames = fastGlob.sync(patterns)
38
+ const filenames = globSync(patterns)
38
39
 
39
40
  filenames.forEach(filename => {
40
41
  let plainFilename: string
@@ -1,8 +1,9 @@
1
1
  import fs from 'node:fs'
2
2
  import path from 'node:path'
3
3
  import { _assert } from '@naturalcycles/js-lib'
4
+ import { globSync } from 'tinyglobby'
4
5
  import { dimGrey, yellow } from '../colors/colors.js'
5
- import { fastGlob, fs2 } from '../index.js'
6
+ import { fs2 } from '../fs/fs2.js'
6
7
  import { encryptObject, encryptRandomIVBuffer } from '../security/crypto.util.js'
7
8
 
8
9
  export interface EncryptCLIOptions {
@@ -30,7 +31,7 @@ export function secretsEncrypt(
30
31
  ...pattern,
31
32
  `!**/*.enc`, // excluding already encoded
32
33
  ]
33
- const filenames = fastGlob.sync(patterns)
34
+ const filenames = globSync(patterns)
34
35
  let encFilename: string
35
36
 
36
37
  filenames.forEach(filename => {
@@ -1,6 +1,7 @@
1
1
  import type { JsonSchema } from '@naturalcycles/js-lib'
2
- import type { FastGlobOptions } from '../../index.js'
3
- import { fastGlob, fs2 } from '../../index.js'
2
+ import type { GlobOptions } from 'tinyglobby'
3
+ import { globSync } from 'tinyglobby'
4
+ import { fs2 } from '../../fs/fs2.js'
4
5
  import type { AjvSchemaCfg } from './ajvSchema.js'
5
6
  import { AjvSchema } from './ajvSchema.js'
6
7
 
@@ -12,8 +13,11 @@ import { AjvSchema } from './ajvSchema.js'
12
13
  *
13
14
  * @experimental
14
15
  */
15
- export function readJsonSchemas(patterns: string | string[], opt?: FastGlobOptions): JsonSchema[] {
16
- return fastGlob.sync(patterns, opt).map(fileName => fs2.readJson(fileName))
16
+ export function readJsonSchemas(
17
+ patterns: string | string[],
18
+ opt?: Omit<GlobOptions, 'patterns'>,
19
+ ): JsonSchema[] {
20
+ return globSync(patterns, opt).map(fileName => fs2.readJson(fileName))
17
21
  }
18
22
 
19
23
  /**
@@ -6,7 +6,9 @@ import {
6
6
  JsonSchemaAnyBuilder,
7
7
  } from '@naturalcycles/js-lib'
8
8
  import type { Ajv, ValidateFunction } from 'ajv'
9
- import { _inspect, fs2, requireFileToExist } from '../../index.js'
9
+ import { fs2 } from '../../fs/fs2.js'
10
+ import { _inspect } from '../../string/inspect.js'
11
+ import { requireFileToExist } from '../../util/env.util.js'
10
12
  import { AjvValidationError } from './ajvValidationError.js'
11
13
  import { getAjv } from './getAjv.js'
12
14