Skip to content

Commit

Permalink
Merge branch 'master' into test/basic-test-env-setup
Browse files Browse the repository at this point in the history
  • Loading branch information
PaulDalek authored Apr 3, 2024
2 parents 7c278e4 + 34ae5cc commit b82a61a
Show file tree
Hide file tree
Showing 14 changed files with 49 additions and 8,298 deletions.
1 change: 1 addition & 0 deletions .env.sample
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ HIGHCHARTS_CORE_SCRIPTS =
HIGHCHARTS_MODULES =
HIGHCHARTS_INDICATORS =
HIGHCHARTS_FORCE_FETCH = false
HIGHCHARTS_CACHE_PATH =
HIGHCHARTS_ADMIN_TOKEN =

# EXPORT CONFIG
Expand Down
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ _Enhancements:_
- Corrected samples, test scenarios, and test runners.
- Removed unnecessary separate `body-parser` package (already implemented in Express v4.16+).
- Bumped versions of most packages, with an update for the deprecated `Puppeteer` v21.1.1.
- Added `mapChart` and `ganttChart` constructors in the exporting UI (#503).
- Added missing Highcharts modules to stay up-to-date with the latest updates.
- Added missing JSDoc descriptions.
- Revamped all log messages, error messages, prompt messages, and info for improved clarity of information.
Expand All @@ -35,6 +36,8 @@ _Enhancements:_
_Fixes:_

- Fixed `multer` related error: 'Field value too long'.
- Fixed the SSL handshake error (#307).
- Fixed missing background color transparency (#492).
- Fixed type compatibility issues in the `pairArgumentValue` function, arising from CLI string arguments.
- Fixed the 'httpsProxyAgent is not a constructor' issue with the `https-proxy-agent` module.
- Fixed the issue of being unable to run both HTTP and HTTPS servers simultaneously.
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ In most cases, v3 should serve as a drop-in replacement for v2. However, due to

Significant changes have been made to the API for using the server as a Node.js module. While a compatibility layer has been created to address this, it is recommended to transition to the new API described below. It is worth noting that the compatibility layer may be deprecated at some point in the future.

An important note is that the Export Server now requires `Node.js v16.14.0` or a higher version.
An important note is that the Export Server now requires `Node.js v18.12.0` or a higher version.

## Changelog

Expand Down Expand Up @@ -42,7 +42,7 @@ For systems that generate automatic reports, using the Export Server as a Node.j

# Install

First, make sure you have Node.js installed. If not, visit [nodejs.org](https://nodejs.org/en/download/), download and install Node.js for your platform.
First, make sure you have Node.js installed. If not, visit [nodejs.org](https://nodejs.org/en/download/), download and install Node.js for your platform. For compatibility reasons, version `18.12.0` or higher is required.

Once Node.js is installed, proceed to install the Export Server by opening a terminal and typing:

Expand Down
4 changes: 2 additions & 2 deletions dist/index.cjs

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/index.esm.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/index.esm.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion lib/export.js
Original file line number Diff line number Diff line change
Expand Up @@ -382,7 +382,7 @@ export default async (page, chart, options) => {
if (exportOptions.type === 'svg') {
// SVG
data = await createSVG(page);
} else if (exportOptions.type === 'png' || exportOptions.type === 'jpeg') {
} else if (['png', 'jpeg'].includes(exportOptions.type)) {
// PNG or JPEG
data = await createImage(
page,
Expand Down
4 changes: 4 additions & 0 deletions lib/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ See LICENSE file in root for details.
*******************************************************************************/

import 'colors';
import dotenv from 'dotenv';

import { checkAndUpdateCache } from './cache.js';
import {
Expand All @@ -33,6 +34,9 @@ import { initPool, killPool } from './pool.js';
import server, { startServer } from './server/server.js';
import { printLogo, printUsage } from './utils.js';

// Load .env into environment variables
dotenv.config();

/**
* Initializes the export process. Tasks such as configuring logging, checking
* cache and sources, and initializing the pool of resources happen during
Expand Down
2 changes: 1 addition & 1 deletion lib/server/server.js
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ export const startServer = async (serverConfig) => {

if (key && cert) {
// Main server instance (HTTPS)
const httpsServer = https.createServer(app);
const httpsServer = https.createServer({ key, cert }, app);

// Attach error handlers and listen to the server
attachErrorHandlers(httpsServer);
Expand Down
5 changes: 3 additions & 2 deletions lib/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -102,8 +102,9 @@ export const fixType = (type, outfile) => {
if (outfile) {
const outType = outfile.split('.').pop();

// Check if extension has a correct type
if (formats.includes(outType) && type !== outType) {
if (outType === 'jpg') {
type = 'jpeg';
} else if (formats.includes(outType) && type !== outType) {
type = outType;
}
}
Expand Down
7 changes: 7 additions & 0 deletions nodemon.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"verbose": true,
"restartable": "rs",
"ext": ".ts,.js,.json",
"watch": ["bin/", "lib/"],
"ignore": ["node_modules/**/node_modules"]
}
Loading

0 comments on commit b82a61a

Please sign in to comment.