jsverse / transloco-keys-manager

🦄 The Key to a Better Translation Experience

Home Page:https://github.com/jsverse/transloco/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Chore: update flat dependency

qdelettre opened this issue · comments

Hi,

Thanks for the tool !

Now that flat v6 has been released, and transloco released with it, could we update this tool as well ?

I tried myself but it seems it needs more love than just bumping the dependency.

 FAIL  __tests__/buildTranslationFiles.spec.ts
  ● Test suite failed to run

    Jest encountered an unexpected token

    Jest failed to parse a file. This happens e.g. when your code or its dependencies use non-standard JavaScript syntax, or when Jest is not configured to support such syntax.

    Out of the box Jest supports Babel, which will be used to transform your files into valid JS based on your Babel configuration.

    By default "node_modules" folder is ignored by transformers.

    Here's what you can do:
     • If you are trying to use ECMAScript Modules, see https://jestjs.io/docs/ecmascript-modules for how to enable it.
     • To have some of your "node_modules" files transformed, you can specify a custom "transformIgnorePatterns" in your config.
     • If you need a custom transformation specify a "transform" option in your config.
     • If you simply want to mock your non-JS modules (e.g. binary assets) you can stub them out with the "moduleNameMapper" config option.

    You'll find more details and examples of these config options in the docs:
    https://jestjs.io/docs/configuration
    For information about custom transformations, see:
    https://jestjs.io/docs/code-transformation

    Details:

    /home/qd/work/github.com/ngneat/transloco-keys-manager/node_modules/flat/index.js:12
    export function flatten (target, opts) {
    ^^^^^^

    SyntaxError: Unexpected token 'export'

    > 1 | import { flatten, unflatten } from 'flat';
        | ^
      2 | import { po } from 'gettext-parser';
      3 |
      4 | import { getConfig } from '../../config';

      at Runtime.createScriptFromCode (node_modules/jest-runtime/build/index.js:1679:14)
      at Object.<anonymous> (src/keys-builder/utils/create-translation.ts:1:1)

Test Suites: 1 failed, 3 passed, 4 total
Tests:       22 passed, 22 total

Same issue here

@qdelettre flat v6 is an ESM library, this library needs to be migrated as well before upgrading.
You are welcome to contribute and open a PR 🙂