Skip to content

Commit d1eed5c

Browse files
committed
adds project update path #11567
1 parent 29516bd commit d1eed5c

File tree

2 files changed

+67
-9
lines changed

2 files changed

+67
-9
lines changed

arches/management/commands/updateproject.py

+47-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
1+
import os
2+
import shutil
3+
14
from django.core.management.base import BaseCommand
25

6+
from arches.app.models.system_settings import settings
7+
38

49
class Command(BaseCommand): # pragma: no cover
510
"""
@@ -18,4 +23,45 @@ def handle(self, *args, **options):
1823
self.stdout.write("Operation aborted.")
1924

2025
def update_to_v8(self):
21-
pass
26+
# Removes unnecessary files
27+
self.stdout.write("Removing unnecessary files...")
28+
29+
for file_to_delete in [
30+
".frontend-configuration-settings.json",
31+
".tsconfig-paths.json",
32+
]:
33+
if os.path.exists(os.path.join(settings.APP_ROOT, "..", file_to_delete)):
34+
self.stdout.write("Deleting {}".format(file_to_delete))
35+
os.remove(os.path.join(settings.APP_ROOT, "..", file_to_delete))
36+
37+
self.stdout.write("Done!")
38+
39+
# Updates webpack
40+
self.stdout.write("Creating updated webpack directory...")
41+
42+
if os.path.isdir(os.path.join(settings.APP_ROOT, "..", "webpack")):
43+
shutil.rmtree(
44+
os.path.join(settings.APP_ROOT, "..", "webpack"), ignore_errors=True
45+
)
46+
47+
shutil.copytree(
48+
os.path.join(settings.ROOT_DIR, "install", "arches-templates", "webpack"),
49+
os.path.join(settings.APP_ROOT, "..", "webpack"),
50+
)
51+
52+
self.stdout.write("Done!")
53+
54+
# Replaces tsconfig.json
55+
self.stdout.write("Updating tsconfig.json...")
56+
57+
if os.path.exists(os.path.join(settings.APP_ROOT, "..", "tsconfig.json")):
58+
os.remove(os.path.join(settings.APP_ROOT, "..", "tsconfig.json"))
59+
60+
shutil.copy2(
61+
os.path.join(
62+
settings.ROOT_DIR, "install", "arches-templates", "tsconfig.json"
63+
),
64+
os.path.join(settings.APP_ROOT, "..", "tsconfig.json"),
65+
)
66+
67+
self.stdout.write("Done!")

releases/8.0.0.md

+20-8
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ Arches 8.0.0 Release Notes
2121
- Improve handling of longer model names [#11317](https://github.com/archesproject/arches/issues/11317)
2222
- Support more expressive plugin URLs [#11320](https://github.com/archesproject/arches/issues/11320)
2323
- Concepts API no longer responds with empty body for error conditions [#11519](https://github.com/archesproject/arches/issues/11519)
24+
- Generates static `urls.json` file for frontend consumption [#11567](https://github.com/archesproject/arches/issues/11567)
2425

2526
### Dependency changes
2627
```
@@ -69,9 +70,9 @@ JavaScript:
6970

7071
1. In settings.py, add the following key to `DATABASES` to [improve indexing performance](https://github.com/archesproject/arches/issues/11382):
7172
```
72-
"OPTIONS": {
73-
"options": "-c cursor_tuple_fraction=1",
74-
},
73+
"OPTIONS": {
74+
"options": "-c cursor_tuple_fraction=1",
75+
},
7576
```
7677
7778
1. Update your frontend dependencies:
@@ -80,21 +81,32 @@ JavaScript:
8081
npm install
8182
```
8283
83-
2. Within your project, with your Python 3 virtual environment activated:
84+
1. Replace the `generate_frontend_configuration` import statement in `apps.py`:
85+
```
86+
from arches.settings_utils import generate_frontend_configuration
87+
```
88+
89+
Should be updated to:
90+
91+
```
92+
from arches.app.utils.frontend_configuration_utils import generate_frontend_configuration
93+
```
94+
95+
1. Within your project, with your Python 3 virtual environment activated:
8496
```
8597
python manage.py migrate
8698
```
8799
88-
3. Create editable_future_graphs for your Resource Models using the command `python manage.py graph create_editable_future_graphs`. This will publish new versions of each Graph.
100+
1. Create editable_future_graphs for your Resource Models using the command `python manage.py graph create_editable_future_graphs`. This will publish new versions of each Graph.
89101
90-
4. Update your Graph publications and Resource instances to point to the newly published Graphs by running `python manage.py graph publish --update -ui`
102+
1. Update your Graph publications and Resource instances to point to the newly published Graphs by running `python manage.py graph publish --update -ui`
91103
92-
5. Within your project with your Python 3 virtual environment activated:
104+
1. Within your project with your Python 3 virtual environment activated:
93105
```
94106
python manage.py es reindex_database
95107
```
96108
97-
6. Run `npm start` or `npm run build_development` to rebuild your static asset bundle:
109+
1. Run `npm start` or `npm run build_development` to rebuild your static asset bundle:
98110
- If running your project in development:
99111
- `npm start` will build the frontend of the application and then start a webpack development server
100112
- `npm run build_development` will build a development bundle for the frontend assests of the application -- this should complete in less than 2 minutes

0 commit comments

Comments
 (0)