Skip to content

Commit

Permalink
initial setup fixes (#240)
Browse files Browse the repository at this point in the history
- removed generated bundle.js
- removed generated output.css
- updated tailwind build path
- updated gitignore to exclude environment.yml confing, output.css and bundle.js
  • Loading branch information
introkun authored Mar 30, 2024
1 parent 6d9fb93 commit c4ed5ad
Show file tree
Hide file tree
Showing 11 changed files with 96 additions and 37,131 deletions.
30 changes: 30 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# EditorConfig helps developers define and maintain consistent
# coding styles between different editors and IDEs

# Top-most EditorConfig file
root = true

# Unix-style newlines with a newline ending every file
[*]
end_of_line = lf
insert_final_newline = true

# Trim trailing whitespace automatically
trim_trailing_whitespace = true

# Set default charset
charset = utf-8

# Use tabs for indentation
[*.{py,html}]
indent_style = space
indent_size = 4

[*.{js,yml}]
indent_style = space
indent_size = 2

# Ignore some directories
[**/__pycache__]
[**/migrations]
[**/node_modules]
22 changes: 22 additions & 0 deletions .github/workflows/push_release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,28 @@ jobs:
id: get_version
run: echo ::set-output name=TAG_NAME::${GITHUB_REF/refs\/tags\//}

#----------------------------------------------
# build Frontend files
#----------------------------------------------
- name: Build frontend
run: |
npm ci
npm run tailwind-build
npm run webpack-build
if [ -f frontend/static/src/output.css ]; then
echo "output.css is created"
else
echo "output.css is not created"
exit 1
fi
if [ -f frontend/static/js/bundle.js ] && [ -f frontend/static/js/bundle.js.map ]; then
echo "bundle.js and bundle.js.map are created"
else
echo "bundle.js and/or bundle.js.map are not created"
exit 1
fi
- name: Configure AWS credentials
id: aws-credentials
uses: aws-actions/configure-aws-credentials@v4
Expand Down
23 changes: 23 additions & 0 deletions .github/workflows/run_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,29 @@ jobs:
- name: Copy docker compose file
run: |
cp $GITHUB_WORKSPACE/$DOCKER_COMPOSE_PATH ./docker-compose.yml
#----------------------------------------------
# build Frontend files
#----------------------------------------------

- name: Install dependencies and build frontend
run: |
npm ci
npm run tailwind-build
npm run webpack-build
if [ -f frontend/static/src/output.css ]; then
echo "output.css is created"
else
echo "output.css is not created"
exit 1
fi
if [ -f frontend/static/js/bundle.js ] && [ -f frontend/static/js/bundle.js.map ]; then
echo "bundle.js and bundle.js.map are created"
else
echo "bundle.js and/or bundle.js.map are not created"
exit 1
fi
#----------------------------------------------
# run docker compose & tests
Expand Down
8 changes: 7 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,7 @@ celerybeat.pid
# Environments
.env
*.env
environment.yml

!.env.sample

Expand Down Expand Up @@ -161,4 +162,9 @@ override.tf.json
terraform.rc

# Temporary (WRITERSIDE)
Writerside/**
Writerside/**

# Generated fronted files
frontend/static/src/output.css
frontend/static/js/bundle.js
frontend/static/js/bundle.js.map
48 changes: 0 additions & 48 deletions Dockerfile

This file was deleted.

7 changes: 6 additions & 1 deletion docs/getting-setup/other-environments/frontend.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,16 @@ npm install
## Build Tailwind

?> You should build tailwind `every time` you want to make any change to the frontend.
<br>Luckily, this is easy with the "watch" command, it auto-builds on any change you make.

```bash
npm run tailwind-build
```

<br>Luckily, this is easy with the "watch" command, it auto-builds on any change you make.

```bash
npm run tailwind-watch
```

!> Please **never** edit the `output.css` file, always edit the `input.css` file if you need to make manual CSS changes.

7 changes: 6 additions & 1 deletion docs/getting-setup/pycharm/frontend.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,16 @@ npm install
## Build Tailwind

?> You should build tailwind `every time` you want to make any change to the frontend.
<br>Luckily, this is easy with the "watch" command, it auto-builds on any change you make.

```bash
npm run tailwind-build
```

<br>Luckily, this is easy with the "watch" command, it auto-builds on any change you make.

```bash
npm run tailwind-watch
```

!> Please **never** edit the `output.css` file, always edit the `input.css` file if you need to make manual CSS changes.

Loading

0 comments on commit c4ed5ad

Please sign in to comment.