Skip to content

Commit

Permalink
Revert breaking change of node engine
Browse files Browse the repository at this point in the history
  • Loading branch information
mathiasrw committed Dec 19, 2022
1 parent b53df04 commit 2111729
Show file tree
Hide file tree
Showing 6 changed files with 1,204 additions and 597 deletions.
7 changes: 4 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "alasql",
"description": "Use SQL to select and filter javascript data - including relational joins and search in nested objects (JSON). Export to and import from Excel and CSV",
"version": "2.2.2",
"version": "2.2.3",
"author": "Andrey Gershun <[email protected]>",
"contributors": [
"Mathias Wulff <[email protected]>"
Expand Down Expand Up @@ -80,10 +80,11 @@
"axios": "^1.0.0",
"marked": "^4.0.10",
"underscore": "^1.12.1",
"glob-parent": "^6.0.0"
"glob-parent": "^6.0.0",
"decode-uri-component": "^0.2.1"
},
"engines": {
"node": ">=14"
"node": "*"

This comment has been minimized.

Copy link
@mathiasrw

mathiasrw Dec 19, 2022

Author Member

@jimmywarting Will get back to v14 here later, but reverting now so we can release the improvements without such a breaking change

This comment has been minimized.

Copy link
@jimmywarting

jimmywarting Dec 19, 2022

Contributor

ok

},
"repository": {
"type": "git",
Expand Down
57 changes: 28 additions & 29 deletions test/browserTestRunner.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,49 +32,48 @@

const testFiles = walkFiles(__dirname, /test\d{3}\.js$/, null, true, true);

const testFilesHtml = testFiles
.map(file => `<script src="${file}"></script>`).join('\n');
const testFilesHtml = testFiles.map((file) => `<script src="${file}"></script>`).join('\n');

var html = template.replace('@INSERT_TESTFILES', testFilesHtml);

// Server from https://gist.github.com/ryanflorence/701407
http.createServer((request, response) => {
let pathname = new URL(`http://localhost/` + request.url).pathname;
http
.createServer((request, response) => {
let pathname = new URL(`http://localhost/` + request.url).pathname;

// normalize leading slash
pathname = '/' + pathname.replace(/^\/+/, '');
// normalize leading slash
pathname = '/' + pathname.replace(/^\/+/, '');

var filename = path.join(__dirname, pathname);
var filename = path.join(__dirname, pathname);

// all subfolder paths starts from ../ folder
if (2 < pathname.split('/').length) {
filename = path.join(__dirname + '/../', pathname);
}
// all subfolder paths starts from ../ folder
if (2 < pathname.split('/').length) {
filename = path.join(__dirname + '/../', pathname);
}

if ('/' === pathname) {
response.writeHead(200, {'Content-Type': 'text/html'});
response.write(html);
response.end();
return;
}
if ('/' === pathname) {
response.writeHead(200, {'Content-Type': 'text/html'});
response.write(html);
response.end();
return;
}

const exists = fs.existsSync(filename);
const exists = fs.existsSync(filename);

if (!exists || fs.statSync(filename).isDirectory()) {
response.writeHead(404, {'Content-Type': 'text/plain'});
response.write('404 Not Found\n');
response.end();
return;
}
if (!exists || fs.statSync(filename).isDirectory()) {
response.writeHead(404, {'Content-Type': 'text/plain'});
response.write('404 Not Found\n');
response.end();
return;
}

response.writeHead(200);
fs.createReadStream(filename).pipe(response);
})
.listen(port);
response.writeHead(200);
fs.createReadStream(filename).pipe(response);
})
.listen(port);

console.log(`Ready to test AlaSQL in the browser at\n => http://localhost:${port}`);
console.log('CTRL + C to shutdown');

exec(`${process.platform === 'win32' ? 'start' : 'open'} http://localhost:${port}`);

}
2 changes: 1 addition & 1 deletion test/test270.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ if (typeof exports === 'object') {
}

describe('Test 270 RECORDSET tests', function () {
const pluck = (arr, key) => arr.map(e => e[key])
const pluck = (arr, key) => arr.map((e) => e[key]);

var emptydata = [];
var data1 = [
Expand Down
2 changes: 1 addition & 1 deletion test/test272.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ if (typeof exports === 'object') {
}

describe('Test 272 REMOVE columns', function () {
const pluck = (arr, key) => arr.map(e => e[key]);
const pluck = (arr, key) => arr.map((e) => e[key]);

before(function () {
alasql('CREATE DATABASE test272; USE test272');
Expand Down
2 changes: 1 addition & 1 deletion test/test273.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ if (typeof exports === 'object') {
}

describe('Test 273 Source columns detextion', function () {
const pluck = (arr, key) => arr.map(e => e[key])
const pluck = (arr, key) => arr.map((e) => e[key]);

before(function () {
alasql('CREATE DATABASE test273; USE test273');
Expand Down
Loading

0 comments on commit 2111729

Please sign in to comment.