Skip to content

Commit

Permalink
Upgrade frontend related stuff
Browse files Browse the repository at this point in the history
Use node 18
Update styling from the default template
Update tooling from the default template
  • Loading branch information
Viicos committed Jan 18, 2024
1 parent f034edd commit 73c3d06
Show file tree
Hide file tree
Showing 61 changed files with 7,464 additions and 9,573 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ jobs:
python-version: '3.10'
- uses: actions/setup-node@v4
with:
node-version: '12'
node-version: '18'

- name: Install system packages
run: |
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,11 +48,11 @@ jobs:
# If you wish to specify custom queries, you can do so here or in a config file.
# By default, queries listed here will override any specified in a config file.
# Prefix the list here with "+" to use these queries and those in the config file.

# 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
# queries: security-extended,security-and-quality


# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
# If this step fails, then you should remove it and run the build manually (see below)
- name: Autobuild
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/generate-postman-collection.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
- name: Use Node.js
uses: actions/setup-node@v4
with:
node-version: '12'
node-version: '18'
- name: Install dependencies
run: npm install -g openapi-to-postmanv2
- name: Create tests folder
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/generate-sdks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
- name: Use Node.js
uses: actions/setup-node@v4
with:
node-version: '12'
node-version: '18'
- name: Install dependencies
run: npm install -g @openapitools/openapi-generator-cli
- name: Determing oas path
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/lint-oas.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
- name: Use Node.js
uses: actions/setup-node@v4
with:
node-version: '12'
node-version: '18'
- name: Install spectral
run: npm install -g @stoplight/spectral@5
- name: Run OAS linter
Expand Down
1 change: 1 addition & 0 deletions .nvmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
18
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ RUN pip install -r requirements/production.txt


# Stage 2 - build frontend
FROM mhart/alpine-node:12 AS frontend-build
FROM node/18-alpine AS frontend-build

WORKDIR /app

Expand All @@ -23,7 +23,7 @@ RUN npm ci
COPY ./webpack.config.js ./.babelrc /app/
COPY ./build /app/build/

COPY src/objects/sass/ /app/src/objects/sass/
COPY src/objects/scss/ /app/src/objects/scss/
COPY src/objects/js/ /app/src/objects/js/
RUN npm run build

Expand Down
15 changes: 5 additions & 10 deletions INSTALL.rst
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ Prerequisites

You need the following libraries and/or programs:

* `Python`_ 3.9 or above
* `Python`_ 3.10 or above
* Python `Virtualenv`_ and `Pip`_
* `PostgreSQL`_ 12 or above with PostGIS extension
* `Node.js`_
Expand Down Expand Up @@ -47,22 +47,20 @@ development machine.
$ git clone [email protected]:maykinmedia/objects-api.git
$ cd objects-api
3. Install all required libraries.
3. Install all required (backend) libraries.

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

.. code-block:: bash
$ npm install -g gulp
$ npm install
$ gulp sass
$ npm run build
5. Activate your virtual environment and create the statics and database:

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

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

.. _ECMA: https://ecma-international.org/
.. _Sass: https://sass-lang.com/
.. _gulp: https://gulpjs.com/


Update installation
Expand All @@ -121,7 +116,7 @@ When updating an existing installation:
$ git pull
$ pip install -r requirements/dev.txt
$ npm install
$ gulp sass
$ npm run build
3. Update the statics and database:

Expand Down
38 changes: 11 additions & 27 deletions build/paths.js
Original file line number Diff line number Diff line change
@@ -1,15 +1,14 @@
var path = require('path');
var fs = require('fs');
const fs = require('fs');


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

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

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


/**
Expand All @@ -19,32 +18,23 @@ module.exports = {
// Parsed package.json
package: pkg,

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

// Path to the sass (sources) entry point
sassSrc: sourcesRoot + 'sass/**/*.scss',

// Path to the (transpiled) css directory
cssDir: staticRoot + 'css/',

// Path to the fonts directory
fontsDir: staticRoot + 'fonts/',
// Path to the scss (sources) directory
scssSrcDir: sourcesRoot + 'scss/',

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

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

// Path to js (sources)
jsSrc: sourcesRoot + 'js/**/*.js',

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

// Path to the (transpiled) js directory
jsDir: staticRoot + 'js/',
jsDir: staticRoot + 'bundles/',

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

// Path to js code coverage directory
coverageDir: 'reports/jstests/',

// Path to HTML templates directory
htmlTemplatesDir: sourcesRoot + 'templates/views',

// Path to HTML includes directory
htmlIncludesDir: sourcesRoot + 'templates/components/'
};
8 changes: 0 additions & 8 deletions build/tasks/build.js

This file was deleted.

100 changes: 0 additions & 100 deletions build/tasks/create-component.js

This file was deleted.

Loading

0 comments on commit 73c3d06

Please sign in to comment.