Page MenuHomePhabricator

Kartotherian fonts placed in a different dir for new node version
Closed, ResolvedPublic

Description

After switching to nodejs v4.2.5 by:

nvm install v4.2.5
nvm use v4.2.5
curl -L https://npmjs.org/install.sh | sh

and re-installing all dependencies via npm install, the osm-bright-fonts was placed in the ./node_modules dir instead of ./node_modules/osm-bright-style/node_modules as before. Apparently npm install places everything in the same root node_modules dir (possibly unless it runs into a conflict). This resulted in kartotherian not working because osm-bright-style uses a hardcoded sub-path for fonts instead of using node's require().

We need to figure out how to either force osm-bright-fonts to always be placed into the predefined subdir by npm install, or to dynamically update all these paths:

Event Timeline

Yurik raised the priority of this task from to Needs Triage.
Yurik updated the task description. (Show Details)
Yurik added a project: Maps.
Yurik added subscribers: Yurik, MaxSem, mobrovac.
Restricted Application added subscribers: StudiesWorld, Aklapper. · View Herald Transcript

require.resolve()
Use the internal require() machinery to look up the location of a module, but rather than loading the module, just return the resolved filename.

@Ricordisamoa, i cannot use require directly - there are three packages: main, resource1 (style), resource2(fonts). The style contains an XML file, which points to a directory in fonts. Main package uses require() machinery to get the location of the XML file, but its parsing is done by the native C++ code. So the only real way i can alter it is by dynamically changing the XML (in memory) to point to a different location of the fonts.

Yurik claimed this task.