Skip to content

Instantly share code, notes, and snippets.

@janwirth
Created August 15, 2019 17:40
Show Gist options
  • Save janwirth/225d8c439543d598f60aa78be4d3b5f9 to your computer and use it in GitHub Desktop.
Save janwirth/225d8c439543d598f60aa78be4d3b5f9 to your computer and use it in GitHub Desktop.
corporate elm
"devDependencies": {
"create-elm-app": "^3.0.6",
"elm-analyse": "^0.16.4",
"elm-format": "^0.8.1",
"elm-i18n": "^1.0.2",
"elm-impfix": "^1.0.8"
},
"scripts": {
"start": "npm run i18n-ensure; elm-app start",
"build": "npm run i18n-ensure; elm-app build",
"test": "elm-app test",
"fix": "npm run impfix && npm run format",
"format": "elm-format src/ --yes",
"impfix": "elm-impfix \"src/**/*.elm\" --replace",
"analyse": "elm-analyse --serve --open",
"i18n-start-edit": "start(){ elm-i18n-generator --format CSV --root I18n --language $1 --export --exportOutput I18n/$1/all.csv;}; start",
"i18n-finish-edit": "finish(){ elm-i18n-generator --format CSV --root I18n --language $1 --import I18n/$1/all.csv;}; finish",
"i18n-new": "new(){ cp -r I18n/$1 I18n/$2;}; new",
"i18n-ensure": "yes n | elm-i18n-switch -l en-US --rootModule ./I18n || true # just ensure that the build can be made",
"i18n-switch": "switch(){ yes y | elm-i18n-switch -l $1 --rootModule ./I18n || true;}; switch",
"build-i18n": "npm run build-clean-i18n && npm run build-i18n-all && mv build-i18n build",
"build-clean-i18n": "rm -rf build build-i18n && mkdir build-i18n",
"build-i18n-all": "for localepath in I18n/*; do npm run build-i18n-one $(basename $localepath); done",
"build-i18n-one": "build(){ npm run i18n-switch $1 && PUBLIC_URL=\"${PUBLIC_URL_BASE}${1}\" npm run build && mv build build-i18n/$1;}; build",
"get-i18n-urls": "for localepath in I18n/*; do echo \"<${PUBLIC_URL_BASE}$(basename $localepath)/index.html|$(basename $localepath)>\\n\"; done"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment