From d412e22230b8e69f154bdd7b3225ad4ab5ff37e3 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 21 Sep 2021 04:49:44 +0000 Subject: [PATCH 1/3] Bump tmpl from 1.0.4 to 1.0.5 Bumps [tmpl](https://github.com/daaku/nodejs-tmpl) from 1.0.4 to 1.0.5. - [Release notes](https://github.com/daaku/nodejs-tmpl/releases) - [Commits](https://github.com/daaku/nodejs-tmpl/commits/v1.0.5) --- updated-dependencies: - dependency-name: tmpl dependency-type: indirect ... Signed-off-by: dependabot[bot] --- package-lock.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/package-lock.json b/package-lock.json index 3815b94..ca5f0bf 100644 --- a/package-lock.json +++ b/package-lock.json @@ -4889,9 +4889,9 @@ "integrity": "sha1-DdTJ/6q8NXlgsbckEV1+Doai4fU=" }, "tmpl": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/tmpl/-/tmpl-1.0.4.tgz", - "integrity": "sha1-I2QN17QtAEM5ERQIIOXPRA5SHdE=", + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/tmpl/-/tmpl-1.0.5.tgz", + "integrity": "sha512-3f0uOEAQwIqGuWW2MVzYg8fV/QNnc/IpuJNG837rLuczAaLVHslWHZQj4IGiEl5Hs3kkbhwL9Ab7Hrsmuj+Smw==", "dev": true }, "to-fast-properties": { From f9053eba05013b4a542f0bbf1d073d697e0c092f Mon Sep 17 00:00:00 2001 From: Julian Rojas Date: Sun, 13 Nov 2022 14:54:48 +0100 Subject: [PATCH 2/3] Fix indexing source path bug --- lib/gtfs2connections.js | 2 +- lib/stores/StoreManager.js | 16 ++++++++-------- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/lib/gtfs2connections.js b/lib/gtfs2connections.js index 2147aad..8224d84 100644 --- a/lib/gtfs2connections.js +++ b/lib/gtfs2connections.js @@ -47,7 +47,7 @@ Mapper.prototype.resultStream = async function (path, output, done) { // Step 2: Read all the required GTFS files and create reusable indexes console.error('Creating index stores...'); - const stores = await StoreManager(output, this._options.store); + const stores = await StoreManager(path, output, this._options.store); // Step 3: Produce (diff) connection rules based on available CPU cores console.error('Creating Connection rules...'); diff --git a/lib/stores/StoreManager.js b/lib/stores/StoreManager.js index 82ece91..02bf79a 100644 --- a/lib/stores/StoreManager.js +++ b/lib/stores/StoreManager.js @@ -3,21 +3,21 @@ const csv = require('fast-csv'); const Store = require('./Store'); const CalendarExpander = require('../services/CalendarExpander'); -module.exports = async function (outPath, storeType) { +module.exports = async function (sourcePath, outPath, storeType) { // Step 2: Read all the required GTFS files in a stream-fashion - const stops = fs.createReadStream(`${outPath}/stops.txt`, { encoding: 'utf8', objectMode: true }) + const stops = fs.createReadStream(`${sourcePath}/stops.txt`, { encoding: 'utf8', objectMode: true }) .pipe(csv.parse({ objectMode: true, headers: true })) .on('error', function (e) { console.error(e); }); - const routes = fs.createReadStream(`${outPath}/routes.txt`, { encoding: 'utf8', objectMode: true }) + const routes = fs.createReadStream(`${sourcePath}/routes.txt`, { encoding: 'utf8', objectMode: true }) .pipe(csv.parse({ objectMode: true, headers: true })) .on('error', function (e) { console.error(e); }); - const trips = fs.createReadStream(`${outPath}/trips.txt`, { encoding: 'utf8', objectMode: true }) + const trips = fs.createReadStream(`${sourcePath}/trips.txt`, { encoding: 'utf8', objectMode: true }) .pipe(csv.parse({ objectMode: true, headers: true })) .on('error', function (e) { console.error(e); @@ -48,17 +48,17 @@ module.exports = async function (outPath, storeType) { encoding: 'json', key: 'trip_id', }), - loadServiceDates(outPath, storeType) + loadServiceDates(sourcePath, outPath, storeType) ]); return { stopsDB, routesDB, tripsDB, servicesDB }; } -async function loadServiceDates(outPath, storeType) { +async function loadServiceDates(sourcePath, outPath, storeType) { // Load all calendar_dates in memory store const calendarDates = new Map(); - const calendarDatesStream = fs.createReadStream(`${outPath}/calendar_dates.txt`, { encoding: 'utf8', objectMode: true }) + const calendarDatesStream = fs.createReadStream(`${sourcePath}/calendar_dates.txt`, { encoding: 'utf8', objectMode: true }) .pipe(csv.parse({ objectMode: true, headers: true })) .on('error', function (e) { console.error(e); @@ -78,7 +78,7 @@ async function loadServiceDates(outPath, storeType) { } // Load and merge all expanded service dates in data store. - const calendar = fs.createReadStream(`${outPath}/calendar.txt`, { encoding: 'utf8', objectMode: true }) + const calendar = fs.createReadStream(`${sourcePath}/calendar.txt`, { encoding: 'utf8', objectMode: true }) .pipe(csv.parse({ objectMode: true, headers: true })) .pipe(new CalendarExpander(calendarDates)) .on('error', function (e) { From 49dce6233e2c727ec509913af90e91166deebba9 Mon Sep 17 00:00:00 2001 From: Julian Rojas Date: Sun, 13 Nov 2022 15:10:35 +0100 Subject: [PATCH 3/3] 2.1.5 --- package-lock.json | 4 ++-- package.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/package-lock.json b/package-lock.json index d73c811..a545053 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "gtfs2lc", - "version": "2.1.4", + "version": "2.1.5", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "gtfs2lc", - "version": "2.1.4", + "version": "2.1.5", "license": "MIT", "dependencies": { "commander": "^4.1.1", diff --git a/package.json b/package.json index b81bfe9..1876a94 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "gtfs2lc", - "version": "2.1.4", + "version": "2.1.5", "description": "Mapping script from gtfs to (linked) connections", "main": "lib/gtfs2lc.js", "bin": {