Add the assemble.mjs file to enable generating the final merged [locale].json files by using the ilib-assemble#491
Add the assemble.mjs file to enable generating the final merged [locale].json files by using the ilib-assemble#491gouniLee wants to merge 8 commits intodevelopmentfrom
assemble.mjs file to enable generating the final merged [locale].json files by using the ilib-assemble#491Conversation
assembleJson.mjs file to enable generating the final merged [locale].json files by using the `ilib-assemble toolassembleJson.mjs file to enable generating the final merged [locale].json files by using the ilib-assemble tool
assembleJson.mjs file to enable generating the final merged [locale].json files by using the ilib-assemble toolassembleJson.mjs file to enable generating the final merged [locale].json files by using the ilib-assemble
assembleJson.mjs file to enable generating the final merged [locale].json files by using the ilib-assembleassemble.mjs file to enable generating the final merged [locale].json files by using the ilib-assemble
| @@ -0,0 +1,50 @@ | |||
| { | |||
| "ethiopic": { | |||
There was a problem hiding this comment.
Why is this file in the PR?
| @@ -0,0 +1,154 @@ | |||
| import path from 'path'; | |||
There was a problem hiding this comment.
Need standard file header
| const file = queue.shift(); | ||
| const fileContent = readFile(path.join(process.cwd(), "js/lib", file)); | ||
| if (fileContent) { | ||
| fileCache.set(file, fileContent); |
There was a problem hiding this comment.
Since the reDependentPattern is re-used, you need to reset the index to re-initialize it before using it with another string:
reDependentPattern.lastIndex = 0;
| jsFiles.forEach(file => { | ||
| const fileContent = fileCache.get(file) || readFile(path.join(process.cwd(), "js/lib", file)); | ||
| if (fileContent) { | ||
| for (const match of fileContent.matchAll(reDataPattern)) { |
| * @returns {object} Flat map of timezone ID to parsed timezone data | ||
| */ | ||
| function assembleZoneinfoData(zoneinfoPath, readFile) { | ||
| const zoneinfoData = {}; |
There was a problem hiding this comment.
This is missing zonetab.json and a few other things. Please take a look at https://github.com/iLib-js/ilib-webpack-plugin/blob/master/ilib-webpack-plugin.js#L196 for how this should be updated
| @@ -0,0 +1,67 @@ | |||
| import path from 'path'; | |||
There was a problem hiding this comment.
Need standard ilib open-source header
| } | ||
| result[locale]["ilib.data.zoneinfo"] = zoneinfoData; | ||
| }); | ||
| } |
There was a problem hiding this comment.
Need special handling for charsets, charmaps, and normalizations. Please see https://github.com/iLib-js/ilib-webpack-plugin/blob/master/ilib-webpack-plugin.js#L157
| @@ -1,4 +1,4 @@ | |||
| # Copyright (c) 2012-2024, JEDLSoft | |||
| # Copyright (c) 2012-2026, JEDLSoft | |||
There was a problem hiding this comment.
| # Copyright (c) 2012-2026, JEDLSoft | |
| # Copyright (c) 2012-2024, 2026, JEDLSoft |
Checklist
ReleaseNoteshas added or is not needed.NodejsandChrome Browser.QT/QML.Description
assemble.mjsfile to enable generating the final merged[locale].jsonfiles by using the `ilib-assemble toolassemble.mjsfile scans it (including its dependencies)related PR
Usage:
ilib-assemble --mergeJson --ilibincPath ./js/assembleData/ilib-inc.js --localefile ./js/assembleData/locales.json --customLocalePath ./js/assembleData/customData assembled[locale].jsonfiles, e.g., ko-KR.json.