diff --git a/CHANGELOG.md b/CHANGELOG.md index ab13478..9c5529f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,7 +3,6 @@ ## 4.1.0 IN PROGRESS * Populate module descriptor's `name` field with module-name if `description` is missing. Refs STCLI-272. -* Use node-native glob functionality in `translate compile`. Refs STCLI-273. ## [4.0.0](https://github.com/folio-org/stripes-cli/tree/v4.0.0) (2025-02-24) [Full Changelog](https://github.com/folio-org/stripes-cli/compare/v3.2.0...v4.0.0) diff --git a/lib/commands/translate/compile.js b/lib/commands/translate/compile.js index 43c032d..bc926c3 100644 --- a/lib/commands/translate/compile.js +++ b/lib/commands/translate/compile.js @@ -10,10 +10,10 @@ const importLazy = require('import-lazy')(require); const fs = importLazy('fs'); const path = importLazy('path'); const process = importLazy('process'); +const fg = importLazy('fast-glob'); const { compile } = importLazy('@formatjs/cli-lib'); const { contextMiddleware } = importLazy('../../cli/context-middleware'); -const { globSync } = fs; /** * createOutDir @@ -42,8 +42,8 @@ function formatjsCompileCommand(argv) { ast: true, format: 'simple', }; - const globSelect = path.join(txPath, '*.json'); - const files = globSync(globSelect); + + const files = fg.globSync(path.join(txPath, '*.json')); if (fs.existsSync(txPath) && files.length > 0) { createOutDir(outDir); Promise.all(files.map(f => compile([f], opts))) diff --git a/package.json b/package.json index 3e9b21b..ff72b39 100644 --- a/package.json +++ b/package.json @@ -31,6 +31,7 @@ "configstore": "^3.1.1", "debug": "^4.0.1", "express": "^4.17.1", + "fast-glob": "^3.3.1", "fast-xml-parser": "^4.2.4", "find-up": "^2.1.0", "fs-extra": "^11.1.1",