forked from satisfactorymodding/smr-frontend
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: dev setup process improvements (satisfactorymodding#127)
* chore: add better error messages to download_translations.sh * chore: setup directions that assume less and cover/avoid common error cases * chore: improved dev sign in steps
- Loading branch information
Showing
3 changed files
with
186 additions
and
61 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,44 +1,15 @@ | ||
# SMR Frontend | ||
|
||
## Development | ||
Frontend for the Satisfactory Mod Repository. | ||
Implemented via NodeJS, Typescript, Svelte, GraphQL, and SMUI. | ||
|
||
See [Contributing](CONTRIBUTING.md) for more information. | ||
|
||
### Setup | ||
|
||
This project uses [pnpm](https://pnpm.js.org/): | ||
|
||
```shell | ||
pnpm install | ||
``` | ||
|
||
After switching branches you should regenerate the graphql files as the schema may have changed: | ||
|
||
```shell | ||
pnpm graphql-codegen | ||
``` | ||
## Contributing | ||
|
||
### Running | ||
Contributions are welcome and encouraged. | ||
|
||
The `dev` script executes several processes: | ||
|
||
* Development Server | ||
* Svelte Checker | ||
* GraphQL Code Generator | ||
* ESLint | ||
|
||
```shell | ||
pnpm dev | ||
``` | ||
|
||
If you don't wish to run the backend (which most likely you don't), | ||
you can point your local frontend to the staging or production APIs using environment variables: | ||
(note this example env var syntax only works in bash) | ||
See [Contributing](CONTRIBUTING.md) for more information. | ||
|
||
```shell | ||
NODE_ENV=staging pnpm dev | ||
NODE_ENV=production pnpm dev | ||
``` | ||
## Setup, Development, Running | ||
|
||
You can make your own `.env.something.local` files if you need to point to a different API | ||
or have a different local configuration. | ||
To avoid duplicating information, all setup and development information is included in the contributing guide. | ||
See [Contributing](CONTRIBUTING.md) for more information. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,32 @@ | ||
#!/usr/bin/env sh | ||
|
||
display_error() { | ||
echo "$1 is not defined, are you sure you correctly loaded the environment variables for the environment you wish to download translations for?" | ||
exit 1 | ||
} | ||
|
||
if [[ -z "${PUBLIC_TOLGEE_API_URL}" ]]; then | ||
display_error "PUBLIC_TOLGEE_API_URL" | ||
else | ||
echo "Using PUBLIC_TOLGEE_API_URL of $PUBLIC_TOLGEE_API_URL" | ||
fi | ||
|
||
if [[ -z "${PUBLIC_TOLGEE_API_KEY}" ]]; then | ||
display_error "PUBLIC_TOLGEE_API_KEY" | ||
else | ||
echo "Using PUBLIC_TOLGEE_API_KEY of $PUBLIC_TOLGEE_API_KEY" | ||
fi | ||
|
||
curl "$PUBLIC_TOLGEE_API_URL/v2/projects/export" -H "X-API-Key: $PUBLIC_TOLGEE_API_KEY" --output translations.zip | ||
|
||
if ! curl "$PUBLIC_TOLGEE_API_URL/v2/projects/export" -H "X-API-Key: $PUBLIC_TOLGEE_API_KEY" --output translations.zip; then | ||
echo "Failed to download translation zip file? Tried using URL:" | ||
echo "$PUBLIC_TOLGEE_API_URL/v2/projects/export" | ||
exit 1 | ||
fi | ||
|
||
unzip -o translations.zip -d src/i18n/ | ||
|
||
rm translations.zip | ||
rm translations.zip | ||
|
||
echo "Translation download appears to have succeeded. Be sure to check above for error messages anyways." |