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

Custom repository name in elm-package.json is not supported #8

Open
kvalle opened this issue Oct 2, 2017 · 0 comments
Open

Custom repository name in elm-package.json is not supported #8

kvalle opened this issue Oct 2, 2017 · 0 comments

Comments

@kvalle
Copy link

kvalle commented Oct 2, 2017

This line assumes that the github repository link is the default user/project: https://github.com/iosphere/elm-i18n/blob/master/index.js#L70

When changed, it causes elm-i18n-switch to miss clearing the cache. Thus, changing language will not affect the compiled result, even though the symlink is updated.

Example output with the "repository": "https://github.com/user/project.git", in elm-package.json:

$ elm-i18n-switch -l En --output dist --yes
Will create symlink from /Users/kvalle/prosjekter/testapp/Translation/En to /Users/kvalle/prosjekter/testapp/src/Translation
Using relative paths Translation/En to src/Translation
elm-make src/Main.elm --yes --output dist/En.js
Success! Compiled 8 modules.
Successfully generated dist/En.js

$ elm-i18n-switch -l No --output dist --yes
Will create symlink from /Users/kvalle/prosjekter/testapp/Translation/No to /Users/kvalle/prosjekter/testapp/src/Translation
Using relative paths Translation/No to src/Translation
clearing out cache at /Users/kvalle/prosjekter/testapp/elm-stuff/build-artifacts/0.18.0/user/project/1.0.0/Translation-Main.elmi
clearing out cache at /Users/kvalle/prosjekter/testapp/elm-stuff/build-artifacts/0.18.0/user/project/1.0.0/Translation-Main.elmo
elm-make src/Main.elm --yes --output dist/No.js
Success! Compiled 3 modules.
Successfully generated dist/No.js

$ diff dist/En.js dist/No.js
13690c13690
< 	return A2(_elm_lang$core$Basics_ops['++'], 'Hi, ', name);
---
> 	return A2(_elm_lang$core$Basics_ops['++'], 'Heisann, ', name);
13692c13692
< var _user$project$Translation_Main$greeting = 'English greeting text. Hi!';
---
> var _user$project$Translation_Main$greeting = 'Norsk tekst med hilsen. Hei!';

The compiled versions are as expected.

But, when changing elm-package.json to contain "repository": "https://github.com/actual-user/the-real-project-name.git",, the following occurs:

$ elm-i18n-switch -l No --output dist --yes
Will create symlink from /Users/kvalle/prosjekter/testapp/Translation/No to /Users/kvalle/prosjekter/testapp/src/Translation
Using relative paths Translation/No to src/Translation
elm-make src/Main.elm --yes --output dist/No.js
Success! Compiled 1 module.
Successfully generated dist/No.js

$ ls -l src | grep Translation
lrwxr-xr-x  1 kvalle  1333597109    65 Oct  2 13:21 Translation -> /Users/kvalle/prosjekter/testapp/Translation/No
$ elm-i18n-switch -l En --output dist --yes
Will create symlink from /Users/kvalle/prosjekter/testapp/Translation/En to /Users/kvalle/prosjekter/testapp/src/Translation
Using relative paths Translation/En to src/Translation
elm-make src/Main.elm --yes --output dist/En.js
Success! Compiled 1 module.
Successfully generated dist/En.js

$ ls -l src | grep Translation
lrwxr-xr-x  1 kvalle  1333597109    65 Oct  2 13:21 Translation -> /Users/kvalle/prosjekter/testapp/Translation/En
$ diff dist/En.js dist/No.js
$

Note that the clearing out cache at line is missing, and the compiled versions are identical.

@kvalle kvalle changed the title Custom repository name in elm-package.json is not supported Custom repository name in elm-package.json is not supported Oct 2, 2017
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