Skip to content

Commit 5f62863

Browse files
committed
Upgrade frontend related stuff
Use node 18 Update styling from the default template Update tooling from the default template
1 parent f034edd commit 5f62863

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

61 files changed

+7471
-9578
lines changed

.github/workflows/ci.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ jobs:
3434
python-version: '3.10'
3535
- uses: actions/setup-node@v4
3636
with:
37-
node-version: '12'
37+
node-version: '18'
3838

3939
- name: Install system packages
4040
run: |

.github/workflows/codeql-analysis.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -48,11 +48,11 @@ jobs:
4848
# If you wish to specify custom queries, you can do so here or in a config file.
4949
# By default, queries listed here will override any specified in a config file.
5050
# Prefix the list here with "+" to use these queries and those in the config file.
51-
51+
5252
# Details on CodeQL's query packs refer to : https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs
5353
# queries: security-extended,security-and-quality
5454

55-
55+
5656
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
5757
# If this step fails, then you should remove it and run the build manually (see below)
5858
- name: Autobuild

.github/workflows/generate-postman-collection.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ jobs:
2323
- name: Use Node.js
2424
uses: actions/setup-node@v4
2525
with:
26-
node-version: '12'
26+
node-version: '18'
2727
- name: Install dependencies
2828
run: npm install -g openapi-to-postmanv2
2929
- name: Create tests folder

.github/workflows/generate-sdks.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ jobs:
2323
- name: Use Node.js
2424
uses: actions/setup-node@v4
2525
with:
26-
node-version: '12'
26+
node-version: '18'
2727
- name: Install dependencies
2828
run: npm install -g @openapitools/openapi-generator-cli
2929
- name: Determing oas path

.github/workflows/lint-oas.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ jobs:
2323
- name: Use Node.js
2424
uses: actions/setup-node@v4
2525
with:
26-
node-version: '12'
26+
node-version: '18'
2727
- name: Install spectral
2828
run: npm install -g @stoplight/spectral@5
2929
- name: Run OAS linter

.nvmrc

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
18

Dockerfile

+9-7
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Stage 1 - Compile needed python dependencies
2-
FROM python:3.10-buster AS build
2+
FROM python:3.10-slim-bullseye AS backend-build
33

44
RUN apt-get update && apt-get install -y --no-install-recommends \
55
libpq-dev \
@@ -13,7 +13,7 @@ RUN pip install -r requirements/production.txt
1313

1414

1515
# Stage 2 - build frontend
16-
FROM mhart/alpine-node:12 AS frontend-build
16+
FROM node:18-alpine AS frontend-build
1717

1818
WORKDIR /app
1919

@@ -23,7 +23,7 @@ RUN npm ci
2323
COPY ./webpack.config.js ./.babelrc /app/
2424
COPY ./build /app/build/
2525

26-
COPY src/objects/sass/ /app/src/objects/sass/
26+
COPY src/objects/scss/ /app/src/objects/scss/
2727
COPY src/objects/js/ /app/src/objects/js/
2828
RUN npm run build
2929

@@ -40,16 +40,18 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
4040
libproj13 \
4141
&& rm -rf /var/lib/apt/lists/*
4242

43-
COPY --from=build /usr/local/lib/python3.10 /usr/local/lib/python3.10
44-
COPY --from=build /usr/local/bin/uwsgi /usr/local/bin/uwsgi
43+
COPY --from=backend-build /usr/local/lib/python3.10 /usr/local/lib/python3.10
44+
COPY --from=backend-build /usr/local/bin/uwsgi /usr/local/bin/uwsgi
4545

4646
# Stage 3.2 - Copy source code
4747
WORKDIR /app
4848
COPY ./bin/docker_start.sh /start.sh
4949
RUN mkdir /app/log /app/config
5050

51-
COPY --from=frontend-build /app/src/objects/static/css /app/src/objects/static/css
52-
COPY --from=frontend-build /app/src/objects/static/js /app/src/objects/static/js
51+
# copy frontend build statics
52+
COPY --from=frontend-build /app/src/objects/static /app/src/objects/static
53+
54+
# copy source code
5355
COPY ./src /app/src
5456

5557
RUN useradd -M -u 1000 user

INSTALL.rst

+5-10
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ Prerequisites
1818

1919
You need the following libraries and/or programs:
2020

21-
* `Python`_ 3.9 or above
21+
* `Python`_ 3.10 or above
2222
* Python `Virtualenv`_ and `Pip`_
2323
* `PostgreSQL`_ 12 or above with PostGIS extension
2424
* `Node.js`_
@@ -47,22 +47,20 @@ development machine.
4747
$ git clone git@github.com:maykinmedia/objects-api.git
4848
$ cd objects-api
4949
50-
3. Install all required libraries.
50+
3. Install all required (backend) libraries.
5151

5252
.. code-block:: bash
5353
5454
$ virtualenv env
5555
$ source env/bin/activate
5656
$ pip install -r requirements/dev.txt
5757
58-
4. Install the front-end CLI tool `gulp`_ if you've never installed them
59-
before and install the frontend libraries:
58+
4. Install all required (frontend) libraries and build static files.
6059

6160
.. code-block:: bash
6261
63-
$ npm install -g gulp
6462
$ npm install
65-
$ gulp sass
63+
$ npm run build
6664
6765
5. Activate your virtual environment and create the statics and database:
6866

@@ -94,12 +92,9 @@ development machine.
9492
``src/objects/conf/local.py``. You can base this file on the
9593
example file included in the same directory.
9694

97-
**Note:** You can run watch-tasks to compile `Sass`_ to CSS and `ECMA`_ to JS
98-
using `gulp`_. By default this will compile the files if they change.
9995

10096
.. _ECMA: https://ecma-international.org/
10197
.. _Sass: https://sass-lang.com/
102-
.. _gulp: https://gulpjs.com/
10398

10499

105100
Update installation
@@ -121,7 +116,7 @@ When updating an existing installation:
121116
$ git pull
122117
$ pip install -r requirements/dev.txt
123118
$ npm install
124-
$ gulp sass
119+
$ npm run build
125120
126121
3. Update the statics and database:
127122

build/paths.js

+11-27
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,14 @@
1-
var path = require('path');
2-
var fs = require('fs');
1+
const fs = require('fs');
32

43

54
/** Parses package.json */
6-
var pkg = JSON.parse(fs.readFileSync('./package.json', 'utf-8'));
5+
const pkg = JSON.parse(fs.readFileSync('./package.json', 'utf-8'));
76

8-
/** Name of the sources directory */
9-
var sourcesRoot = 'src/' + pkg.name + '/';
7+
/** Src dir */
8+
const sourcesRoot = 'src/' + pkg.name + '/';
109

11-
/** Name of the static (source) directory */
12-
var staticRoot = sourcesRoot + 'static/';
10+
/** "Main" static dir */
11+
const staticRoot = sourcesRoot + 'static/';
1312

1413

1514
/**
@@ -19,32 +18,23 @@ module.exports = {
1918
// Parsed package.json
2019
package: pkg,
2120

22-
// Path to the sass (sources) directory
23-
sassSrcDir: sourcesRoot + 'sass/',
21+
// Path to the scss entry point
22+
scssEntry: sourcesRoot + 'scss/screen.scss',
2423

25-
// Path to the sass (sources) entry point
26-
sassSrc: sourcesRoot + 'sass/**/*.scss',
27-
28-
// Path to the (transpiled) css directory
29-
cssDir: staticRoot + 'css/',
30-
31-
// Path to the fonts directory
32-
fontsDir: staticRoot + 'fonts/',
24+
// Path to the scss (sources) directory
25+
scssSrcDir: sourcesRoot + 'scss/',
3326

3427
// Path to the js entry point (source)
3528
jsEntry: sourcesRoot + 'js/index.js',
3629

37-
// Path to the js (sources) directory
38-
jsSrcDir: sourcesRoot + 'js/',
39-
4030
// Path to js (sources)
4131
jsSrc: sourcesRoot + 'js/**/*.js',
4232

4333
// Path to the js (sources) directory
4434
jsSrcDir: sourcesRoot + 'js/',
4535

4636
// Path to the (transpiled) js directory
47-
jsDir: staticRoot + 'js/',
37+
jsDir: staticRoot + 'bundles/',
4838

4939
// Path to js spec (test) files
5040
jsSpec: sourcesRoot + 'jstests/**/*.spec.js',
@@ -54,10 +44,4 @@ module.exports = {
5444

5545
// Path to js code coverage directory
5646
coverageDir: 'reports/jstests/',
57-
58-
// Path to HTML templates directory
59-
htmlTemplatesDir: sourcesRoot + 'templates/views',
60-
61-
// Path to HTML includes directory
62-
htmlIncludesDir: sourcesRoot + 'templates/components/'
6347
};

build/tasks/build.js

-8
This file was deleted.

build/tasks/create-component.js

-100
This file was deleted.

0 commit comments

Comments
 (0)