Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug: Input and Translations path not found #159

Open
1 task done
maxbeba opened this issue Apr 28, 2023 · 0 comments
Open
1 task done

Bug: Input and Translations path not found #159

maxbeba opened this issue Apr 28, 2023 · 0 comments

Comments

@maxbeba
Copy link

maxbeba commented Apr 28, 2023

Is there an existing issue for this?

  • I have searched the existing issues

Is this a regression?

Yes

Current behavior

I am running "transloco-keys-manager extract" in an nx workspace using the nx:run-commands executor.
My project.json is located in apps/mobile, so the cwd for the command is set to that path.

My understanding is, that the input path should be relative to the cwd, correct?

It results only in the error message "Input path provided doesn't exist!"
You can see the paths in config and log below.

"extract-i18n": {
      "executor": "nx:run-commands",
      "options": {
        "command": "DEBUG=* transloco-keys-manager extract",
        "cwd": "apps/mobile"
      }
    },

As this is a quite special setup of an ionic app in nx workspace there is a project.json and an angular.json in apps/mobile because of some stupid issue in ionic cli. The source root in both is the same. But my logic tells me that these files should not matter as the transloco.config.js defines relative paths to cwd.

project.json

{
  "name": "mobile",
  "$schema": "../../node_modules/nx/schemas/project-schema.json",
  "projectType": "application",
  "prefix": "mobile",
  "sourceRoot": "apps/mobile/src",
  "tags": [],

angular.json

{
  "$schema": "../../node_modules/@angular/cli/lib/config/schema.json",
  "version": 1,
  "projects": {
    "mobile": {
      "projectType": "application",
      "schematics": {
        "@schematics/angular:component": {
          "style": "scss"
        },
        "@ionic/angular-toolkit:page": {
          "styleext": "scss",
          "standalone": true
        }
      },
      "root": "apps/mobile",
      "sourceRoot": "apps/mobile/src",
      "prefix": "mobile",

Expected behavior

It should find the paths...

Please provide a link to a minimal reproduction of the bug

Transloco Config

module.exports = {
  keysManager: {
    input: 'src/app',
    translationsPath: 'src/assets/i18n',
  }
}

Debug Logs

🐞 DEBUG - Config:
2023-04-28T18:54:07.497Z  Default: {
  input: [ 'app' ],
  output: 'assets/i18n',
  langs: [ 'en' ],
  marker: 't',
  sort: false,
  defaultValue: undefined,
  replace: false,
  removeExtraKeys: false,
  addMissingKeys: false,
  emitErrorOnExtraKeys: false,
  translationsPath: 'assets/i18n',
  fileFormat: 'json'
}
2023-04-28T18:54:07.497Z  Transloco file: { input: [ 'src/app' ], translationsPath: 'src/assets/i18n' }
2023-04-28T18:54:07.497Z  Inline: { command: 'extract' }
2023-04-28T18:54:07.497Z  Merged: {
  input: [ 'src/app' ],
  output: 'assets/i18n',
  langs: [ 'en' ],
  marker: 't',
  sort: false,
  defaultValue: undefined,
  replace: false,
  removeExtraKeys: false,
  addMissingKeys: false,
  emitErrorOnExtraKeys: false,
  translationsPath: 'src/assets/i18n',
  fileFormat: 'json',
  command: 'extract'
}
Input path provided doesn't exist!


### Please provide the environment you discovered this bug in

```markdown
Transloco: ^4.2.6
Transloco Keys Manager: ^3.7.0
Angular: ~15.2.0
Node: v16.18.0
Package Manager: npm
OS: MacOS

Additional context

No response

I would like to make a pull request for this bug

No

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant