@rr0/cms 0.1.16 → 0.1.18
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +20 -2
- package/dist/DefaultContentVisitor.d.ts +1 -3
- package/dist/OpenGraphCommand.js +1 -1
- package/dist/OpenGraphCommand.test.js +14 -0
- package/dist/RR0Build.d.ts +56 -0
- package/dist/RR0Build.js +253 -0
- package/dist/RR0Build.test.js +106 -0
- package/dist/RR0Context.d.ts +6 -4
- package/dist/RR0Context.js +4 -0
- package/dist/TableReplaceCommand.js +2 -1
- package/dist/anchor/AnchorReplaceCommandTest.js +23 -0
- package/dist/anchor/AnchorReplacerTest.js +60 -0
- package/dist/anchor/CaseAnchorHandler.js +1 -1
- package/dist/anchor/DataAnchorHandler.d.ts +1 -2
- package/dist/book/Book.d.ts +1 -1
- package/dist/book/BookDirectoryStep.d.ts +3 -3
- package/dist/book/BookDirectoryStep.js +2 -1
- package/dist/book/BookService.d.ts +3 -3
- package/dist/book/BookService.js +2 -2
- package/dist/index.d.ts +1 -2
- package/dist/index.js +1 -2
- package/dist/lang/LanguageReplaceCommant.test.js +17 -0
- package/dist/lang/RR0Messages.d.ts +1 -0
- package/dist/lang/RR0Messages_en.d.ts +1 -0
- package/dist/lang/RR0Messages_en.js +2 -1
- package/dist/lang/RR0Messages_fr.d.ts +1 -0
- package/dist/lang/RR0Messages_fr.js +2 -1
- package/dist/org/Cities.js +12 -20
- package/dist/org/CountryMessageList_en.js +2 -1
- package/dist/org/CountryMessageList_fr.js +2 -1
- package/dist/org/Organization.d.ts +1 -2
- package/dist/org/OrganizationFactory.d.ts +1 -2
- package/dist/org/OrganizationFactory.js +1 -1
- package/dist/org/OrganizationService.d.ts +5 -1
- package/dist/org/OrganizationService.js +5 -1
- package/dist/org/au/Australia_en.d.ts +1 -1
- package/dist/org/au/Australia_fr.d.ts +1 -1
- package/dist/org/au/region/vic/Victoria.d.ts +1 -1
- package/dist/org/au/region/vic/Victoria.js +1 -1
- package/dist/org/au/region/vic/VictoriaMessages_en.d.ts +2 -2
- package/dist/org/au/region/vic/VictoriaMessages_en.js +2 -2
- package/dist/org/au/region/vic/VictoriaMessages_fr.d.ts +2 -2
- package/dist/org/au/region/vic/VictoriaMessages_fr.js +2 -2
- package/dist/org/cn/China.d.ts +6 -0
- package/dist/org/cn/China.js +6 -0
- package/dist/org/cn/ChinaMessages.d.ts +1 -0
- package/dist/org/cn/ChinaMessages_cn.d.ts +3 -0
- package/dist/org/cn/ChinaMessages_cn.js +5 -0
- package/dist/org/cn/ChinaMessages_en.d.ts +3 -0
- package/dist/org/cn/ChinaMessages_en.js +5 -0
- package/dist/org/cn/ChinaMessages_fr.d.ts +3 -0
- package/dist/org/cn/ChinaMessages_fr.js +5 -0
- package/dist/org/cn/region/ChinaCities.d.ts +2 -0
- package/dist/org/cn/region/ChinaCities.js +4 -0
- package/dist/org/cn/region/ChinaRegion.d.ts +4 -0
- package/dist/org/cn/region/ChinaRegion.js +5 -0
- package/dist/org/cn/region/ChinaRegionCode.d.ts +3 -0
- package/dist/org/cn/region/ChinaRegionCode.js +4 -0
- package/dist/org/cn/region/ChinaRegions.d.ts +2 -0
- package/dist/org/cn/region/ChinaRegions.js +4 -0
- package/dist/org/cn/region/n/NorthChina.d.ts +2 -0
- package/dist/org/cn/region/n/NorthChina.js +4 -0
- package/dist/org/cn/region/n/NorthChinaDepartmentCode.d.ts +3 -0
- package/dist/org/cn/region/n/NorthChinaDepartmentCode.js +4 -0
- package/dist/org/cn/region/n/NorthChinaMessages_cn.d.ts +6 -0
- package/dist/org/cn/region/n/NorthChinaMessages_cn.js +6 -0
- package/dist/org/cn/region/n/NorthChinaMessages_en.d.ts +6 -0
- package/dist/org/cn/region/n/NorthChinaMessages_en.js +6 -0
- package/dist/org/cn/region/n/NorthChinaMessages_fr.d.ts +6 -0
- package/dist/org/cn/region/n/NorthChinaMessages_fr.js +6 -0
- package/dist/org/cn/region/n/ji/Hebei.d.ts +2 -0
- package/dist/org/cn/region/n/ji/Hebei.js +5 -0
- package/dist/org/cn/region/n/ji/HebeiCities.d.ts +2 -0
- package/dist/org/cn/region/n/ji/HebeiCities.js +4 -0
- package/dist/org/cn/region/n/ji/HebeiCityCode.d.ts +3 -0
- package/dist/org/cn/region/n/ji/HebeiCityCode.js +4 -0
- package/dist/org/cn/region/n/ji/HebeiMessages_cn.d.ts +4 -0
- package/dist/org/cn/region/n/ji/HebeiMessages_cn.js +6 -0
- package/dist/org/cn/region/n/ji/HebeiMessages_en.d.ts +4 -0
- package/dist/org/cn/region/n/ji/HebeiMessages_en.js +6 -0
- package/dist/org/cn/region/n/ji/HebeiMessages_fr.d.ts +4 -0
- package/dist/org/cn/region/n/ji/HebeiMessages_fr.js +6 -0
- package/dist/org/cn/region/n/ji/Tianjin/Tianjin.d.ts +2 -0
- package/dist/org/cn/region/n/ji/Tianjin/Tianjin.js +5 -0
- package/dist/org/cn/region/n/ji/Tianjin/TianjinMessages_cn.d.ts +2 -0
- package/dist/org/cn/region/n/ji/Tianjin/TianjinMessages_cn.js +2 -0
- package/dist/org/cn/region/n/ji/Tianjin/TianjinMessages_en.d.ts +2 -0
- package/dist/org/cn/region/n/ji/Tianjin/TianjinMessages_en.js +2 -0
- package/dist/org/cn/region/n/ji/Tianjin/TianjinMessages_fr.d.ts +2 -0
- package/dist/org/cn/region/n/ji/Tianjin/TianjinMessages_fr.js +3 -0
- package/dist/org/country/CountryMessages.test.d.ts +1 -0
- package/dist/org/country/CountryMessages.test.js +20 -0
- package/dist/org/country/CountryService.test.d.ts +1 -0
- package/dist/org/country/CountryService.test.js +11 -0
- package/dist/org/country/region/RegionMessages.test.d.ts +1 -0
- package/dist/org/country/region/RegionMessages.test.js +17 -0
- package/dist/org/country/region/RegionService.test.d.ts +1 -0
- package/dist/org/country/region/RegionService.test.js +13 -0
- package/dist/org/country/region/department/DeparmentMessages.test.d.ts +1 -0
- package/dist/org/country/region/department/DeparmentMessages.test.js +22 -0
- package/dist/org/country/region/department/DepartmentService.test.d.ts +1 -0
- package/dist/org/country/region/department/DepartmentService.test.js +13 -0
- package/dist/org/country/region/department/city/CityMessages.test.d.ts +1 -0
- package/dist/org/country/region/department/city/CityMessages.test.js +34 -0
- package/dist/org/country/region/department/city/CityService.test.d.ts +1 -0
- package/dist/org/country/region/department/city/CityService.test.js +19 -0
- package/dist/org/do/DominicanRepublicMessages.d.ts +1 -1
- package/dist/org/do/DominicanRepublic_en.d.ts +2 -2
- package/dist/org/do/DominicanRepublic_fr.d.ts +2 -2
- package/dist/org/eu/fr/FranceMessages.test.d.ts +1 -0
- package/dist/org/eu/fr/FranceMessages.test.js +11 -0
- package/dist/org/eu/fr/cnes/geipan/geipan/GeipanDatasource.test.d.ts +1 -0
- package/dist/org/eu/fr/cnes/geipan/geipan/GeipanDatasource.test.js +30 -0
- package/dist/org/us/region/UsaCountyCode.d.ts +7 -1
- package/dist/org/us/region/UsaCountyCode.js +7 -1
- package/dist/org/us/region/mn/MinnesotaCities.js +2 -2
- package/dist/org/us/region/mn/MinnesotaCounties.js +2 -2
- package/dist/org/us/region/mn/Minnesota_en.d.ts +2 -2
- package/dist/org/us/region/mn/Minnesota_en.js +2 -2
- package/dist/org/us/region/mn/Minnesota_fr.d.ts +2 -2
- package/dist/org/us/region/mn/Minnesota_fr.js +2 -2
- package/dist/org/us/region/mn/{kalamazoo/Kalamazoo.d.ts → hennepin/Hennepin.d.ts} +1 -1
- package/dist/org/us/region/mn/{kalamazoo/Kalamazoo.js → hennepin/Hennepin.js} +1 -1
- package/dist/org/us/region/mn/{kalamazoo/KalamazooCities.d.ts → hennepin/HennepinCities.d.ts} +1 -1
- package/dist/org/us/region/mn/hennepin/HennepinCities.js +4 -0
- package/dist/org/us/region/mn/hennepin/HennepinCityCode.d.ts +3 -0
- package/dist/org/us/region/mn/hennepin/HennepinCityCode.js +4 -0
- package/dist/org/us/region/mn/hennepin/HennepinMessages_en.d.ts +4 -0
- package/dist/org/us/region/mn/hennepin/HennepinMessages_en.js +6 -0
- package/dist/org/us/region/mn/hennepin/HennepinMessages_fr.d.ts +4 -0
- package/dist/org/us/region/mn/hennepin/HennepinMessages_fr.js +6 -0
- package/dist/org/us/region/mn/hennepin/Minneapolis/Minneapolis.d.ts +1 -0
- package/dist/org/us/region/mn/hennepin/Minneapolis/Minneapolis.js +5 -0
- package/dist/org/us/region/mn/hennepin/Minneapolis/MinneapolisMessages.d.ts +2 -0
- package/dist/org/us/region/mn/hennepin/Minneapolis/MinneapolisMessages.js +2 -0
- package/dist/org/us/region/mo/MissouriCities.js +2 -2
- package/dist/org/us/region/mo/MissouriCounties.js +2 -2
- package/dist/org/us/region/mo/Missouri_en.d.ts +2 -2
- package/dist/org/us/region/mo/Missouri_en.js +2 -2
- package/dist/org/us/region/mo/Missouri_fr.d.ts +2 -2
- package/dist/org/us/region/mo/Missouri_fr.js +2 -2
- package/dist/org/us/region/{mn/kalamazoo/galesburg/Galesburg.d.ts → mo/pike/Louisiana/Louisiana.d.ts} +1 -1
- package/dist/org/us/region/mo/pike/Louisiana/Louisiana.js +5 -0
- package/dist/org/us/region/{mn/kalamazoo/galesburg/GalesburgMessages.d.ts → mo/pike/Louisiana/LouisianaMessages.d.ts} +1 -1
- package/dist/org/us/region/{ms/kalamazoo/galesburg/GalesburgMessages.js → mo/pike/Louisiana/LouisianaMessages.js} +1 -1
- package/dist/org/us/region/mo/{kalamazoo/Kalamazoo.d.ts → pike/Pike.d.ts} +1 -1
- package/dist/org/us/region/mo/{kalamazoo/Kalamazoo.js → pike/Pike.js} +1 -1
- package/dist/org/us/region/mo/{kalamazoo/KalamazooCities.d.ts → pike/PikeCities.d.ts} +1 -1
- package/dist/org/us/region/mo/pike/PikeCities.js +4 -0
- package/dist/org/us/region/mo/pike/PikeCityCode.d.ts +3 -0
- package/dist/org/us/region/mo/pike/PikeCityCode.js +4 -0
- package/dist/org/us/region/mo/pike/PikeMessages_en.d.ts +4 -0
- package/dist/org/us/region/mo/pike/PikeMessages_en.js +6 -0
- package/dist/org/us/region/mo/pike/PikeMessages_fr.d.ts +4 -0
- package/dist/org/us/region/mo/pike/PikeMessages_fr.js +6 -0
- package/dist/org/us/region/ms/MississippiCities.js +2 -2
- package/dist/org/us/region/ms/MississippiCounties.js +2 -2
- package/dist/org/us/region/ms/Mississippi_en.d.ts +2 -2
- package/dist/org/us/region/ms/Mississippi_en.js +2 -2
- package/dist/org/us/region/ms/Mississippi_fr.d.ts +2 -2
- package/dist/org/us/region/ms/Mississippi_fr.js +2 -2
- package/dist/org/us/region/ms/{kalamazoo/Kalamazoo.d.ts → hinds/Hinds.d.ts} +1 -1
- package/dist/org/us/region/ms/{kalamazoo/Kalamazoo.js → hinds/Hinds.js} +1 -1
- package/dist/org/us/region/ms/{kalamazoo/KalamazooCities.d.ts → hinds/HindsCities.d.ts} +1 -1
- package/dist/org/us/region/ms/hinds/HindsCities.js +4 -0
- package/dist/org/us/region/ms/hinds/HindsCityCode.d.ts +3 -0
- package/dist/org/us/region/ms/hinds/HindsCityCode.js +4 -0
- package/dist/org/us/region/ms/hinds/HindsMessages_en.d.ts +4 -0
- package/dist/org/us/region/ms/hinds/HindsMessages_en.js +6 -0
- package/dist/org/us/region/ms/hinds/HindsMessages_fr.d.ts +4 -0
- package/dist/org/us/region/ms/hinds/HindsMessages_fr.js +6 -0
- package/dist/org/us/region/ms/hinds/Jackson/Jackson.d.ts +1 -0
- package/dist/org/us/region/ms/hinds/Jackson/Jackson.js +5 -0
- package/dist/org/us/region/ms/{kalamazoo/galesburg/GalesburgMessages.d.ts → hinds/Jackson/JacksonMessages.d.ts} +1 -1
- package/dist/org/us/region/ms/hinds/Jackson/JacksonMessages.js +2 -0
- package/dist/org/us/region/mt/MontanaCities.js +2 -2
- package/dist/org/us/region/mt/MontanaCounties.js +2 -2
- package/dist/org/us/region/mt/Montana_en.d.ts +2 -2
- package/dist/org/us/region/mt/Montana_en.js +2 -2
- package/dist/org/us/region/mt/Montana_fr.d.ts +2 -2
- package/dist/org/us/region/mt/Montana_fr.js +2 -2
- package/dist/org/us/region/mt/{kalamazoo/Kalamazoo.d.ts → cascade/Cascade.d.ts} +1 -1
- package/dist/org/us/region/mt/{kalamazoo/Kalamazoo.js → cascade/Cascade.js} +1 -1
- package/dist/org/us/region/mt/{kalamazoo/KalamazooCities.d.ts → cascade/CascadeCities.d.ts} +1 -1
- package/dist/org/us/region/mt/cascade/CascadeCities.js +4 -0
- package/dist/org/us/region/mt/cascade/CascadeCityCode.d.ts +3 -0
- package/dist/org/us/region/mt/cascade/CascadeCityCode.js +4 -0
- package/dist/org/us/region/mt/cascade/CascadeMessages_en.d.ts +4 -0
- package/dist/org/us/region/mt/cascade/CascadeMessages_en.js +6 -0
- package/dist/org/us/region/mt/cascade/CascadeMessages_fr.d.ts +4 -0
- package/dist/org/us/region/mt/cascade/CascadeMessages_fr.js +6 -0
- package/dist/org/us/region/mt/cascade/GreatFalls/GreatFalls.d.ts +1 -0
- package/dist/org/us/region/mt/cascade/GreatFalls/GreatFalls.js +5 -0
- package/dist/org/us/region/mt/{kalamazoo/galesburg/GalesburgMessages.d.ts → cascade/GreatFalls/GreatFallsMessages.d.ts} +1 -1
- package/dist/org/us/region/mt/cascade/GreatFalls/GreatFallsMessages.js +2 -0
- package/dist/org/us/region/nh/NewHampshireCities.js +2 -2
- package/dist/org/us/region/nh/NewHampshireCounties.js +2 -2
- package/dist/org/us/region/nh/NewHampshire_en.d.ts +2 -2
- package/dist/org/us/region/nh/NewHampshire_en.js +2 -2
- package/dist/org/us/region/nh/NewHampshire_fr.d.ts +2 -2
- package/dist/org/us/region/nh/NewHampshire_fr.js +2 -2
- package/dist/org/us/region/nh/rockingham/Portsmouth/Portsmouth.d.ts +1 -0
- package/dist/org/us/region/nh/rockingham/Portsmouth/Portsmouth.js +5 -0
- package/dist/org/us/region/nh/rockingham/Portsmouth/PortsmouthMessages.d.ts +2 -0
- package/dist/org/us/region/nh/rockingham/Portsmouth/PortsmouthMessages.js +2 -0
- package/dist/org/us/region/nh/rockingham/Rockingham.d.ts +2 -0
- package/dist/org/us/region/nh/{kalamazoo/Kalamazoo.js → rockingham/Rockingham.js} +1 -1
- package/dist/org/us/region/nh/rockingham/RockinghamCities.d.ts +2 -0
- package/dist/org/us/region/nh/rockingham/RockinghamCities.js +4 -0
- package/dist/org/us/region/nh/rockingham/RockinghamCityCode.d.ts +3 -0
- package/dist/org/us/region/nh/rockingham/RockinghamCityCode.js +4 -0
- package/dist/org/us/region/nh/rockingham/RockinghamMessages_en.d.ts +4 -0
- package/dist/org/us/region/nh/rockingham/RockinghamMessages_en.js +6 -0
- package/dist/org/us/region/nh/rockingham/RockinghamMessages_fr.d.ts +4 -0
- package/dist/org/us/region/nh/rockingham/RockinghamMessages_fr.js +6 -0
- package/dist/org/us/region/nv/NevadaCities.js +2 -2
- package/dist/org/us/region/nv/NevadaCounties.js +2 -2
- package/dist/org/us/region/nv/Nevada_en.d.ts +2 -2
- package/dist/org/us/region/nv/Nevada_en.js +2 -2
- package/dist/org/us/region/nv/Nevada_fr.d.ts +2 -2
- package/dist/org/us/region/nv/Nevada_fr.js +2 -2
- package/dist/org/us/region/nv/clark/Clark.d.ts +2 -0
- package/dist/org/us/region/nv/{kalamazoo/Kalamazoo.js → clark/Clark.js} +1 -1
- package/dist/org/us/region/nv/clark/ClarkCities.d.ts +2 -0
- package/dist/org/us/region/nv/clark/ClarkCities.js +4 -0
- package/dist/org/us/region/nv/clark/ClarkCityCode.d.ts +3 -0
- package/dist/org/us/region/nv/clark/ClarkCityCode.js +4 -0
- package/dist/org/us/region/nv/clark/ClarkMessages_en.d.ts +4 -0
- package/dist/org/us/region/nv/clark/ClarkMessages_en.js +6 -0
- package/dist/org/us/region/nv/clark/ClarkMessages_fr.d.ts +4 -0
- package/dist/org/us/region/nv/clark/ClarkMessages_fr.js +6 -0
- package/dist/org/us/region/nv/clark/LasVegas/LasVegas.d.ts +1 -0
- package/dist/org/us/region/nv/clark/LasVegas/LasVegas.js +5 -0
- package/dist/org/us/region/{mo/kalamazoo/galesburg/GalesburgMessages.d.ts → nv/clark/LasVegas/LasVegasMessages.d.ts} +1 -1
- package/dist/org/us/region/nv/clark/LasVegas/LasVegasMessages.js +2 -0
- package/dist/people/People.d.ts +1 -2
- package/dist/people/People.test.d.ts +1 -0
- package/dist/people/People.test.js +34 -0
- package/dist/people/PeopleDirectoryStep.d.ts +2 -2
- package/dist/people/PeopleDirectoryStepFactory.d.ts +27 -14
- package/dist/people/PeopleDirectoryStepFactory.js +66 -44
- package/dist/people/PeopleFactory.d.ts +1 -2
- package/dist/people/PeopleFactory.js +1 -1
- package/dist/people/PeopleFactory.test.d.ts +1 -0
- package/dist/people/PeopleFactory.test.js +81 -0
- package/dist/people/PeopleRegexReplaceCommand.test.d.ts +1 -0
- package/dist/people/PeopleRegexReplaceCommand.test.js +17 -0
- package/dist/people/PeopleReplacer.test.d.ts +1 -0
- package/dist/people/PeopleReplacer.test.js +58 -0
- package/dist/people/PeopleService.d.ts +1 -1
- package/dist/people/PeopleService.js +1 -1
- package/dist/people/author/AuthorReplaceCommandTest.d.ts +1 -0
- package/dist/people/author/AuthorReplaceCommandTest.js +49 -0
- package/dist/place/Place.d.ts +1 -2
- package/dist/place/PlaceReplacer.test.d.ts +1 -0
- package/dist/place/PlaceReplacer.test.js +91 -0
- package/dist/place/PlaceService.js +2 -2
- package/dist/place/PlaceService.test.d.ts +1 -0
- package/dist/place/PlaceService.test.js +28 -0
- package/dist/science/crypto/ufo/enquete/dossier/CaseDirectoryStep.d.ts +2 -3
- package/dist/science/crypto/ufo/enquete/dossier/CaseDirectoryStep.js +0 -4
- package/dist/science/crypto/ufo/enquete/dossier/CaseDirectoryStep.test.d.ts +1 -0
- package/dist/science/crypto/ufo/enquete/dossier/CaseDirectoryStep.test.js +34 -0
- package/dist/science/crypto/ufo/enquete/dossier/CaseFactory.d.ts +1 -2
- package/dist/science/crypto/ufo/enquete/dossier/CaseFactory.js +1 -1
- package/dist/science/crypto/ufo/enquete/dossier/CaseService.d.ts +1 -1
- package/dist/science/crypto/ufo/enquete/dossier/CaseService.js +1 -1
- package/dist/search/SearchIndexStep.js +2 -2
- package/dist/search/SearchVisitor.js +1 -1
- package/dist/source/PersistentSourceRegistry.d.ts +2 -2
- package/dist/source/PersistentSourceRegistry.js +8 -3
- package/dist/source/SourceFactory.d.ts +2 -2
- package/dist/source/SourceFactory.js +1 -1
- package/dist/source/SourceIndexStep.js +2 -2
- package/dist/source/SourceRegistry.d.ts +2 -2
- package/dist/source/SourceRenderer.d.ts +1 -1
- package/dist/source/SourceRenderer.js +1 -1
- package/dist/source/index.d.ts +0 -3
- package/dist/source/index.js +0 -3
- package/dist/tech/info/soft/API.d.ts +1 -1
- package/dist/tech/info/soft/APIFactory.d.ts +1 -2
- package/dist/tech/info/soft/APIFactory.js +1 -1
- package/dist/tech/info/soft/proj/impl/lang/CodeReplacerTest.d.ts +1 -0
- package/dist/tech/info/soft/proj/impl/lang/CodeReplacerTest.js +50 -0
- package/dist/test/RR0TestUtil.d.ts +21 -0
- package/dist/test/RR0TestUtil.js +72 -0
- package/dist/test/index.d.ts +1 -0
- package/dist/test/index.js +1 -0
- package/dist/time/EventRenderer.d.ts +3 -3
- package/dist/time/EventRenderer.js +1 -1
- package/dist/time/EventReplacerFactory.d.ts +1 -2
- package/dist/time/Time.js +1 -1
- package/dist/time/Time.test.d.ts +1 -0
- package/dist/time/Time.test.js +48 -0
- package/dist/time/TimeEventRenderer.test.d.ts +1 -0
- package/dist/time/TimeEventRenderer.test.js +56 -0
- package/dist/time/TimeService.d.ts +1 -2
- package/dist/time/TimeService.js +1 -1
- package/dist/time/TimeTagReplaceCommand.test.d.ts +1 -0
- package/dist/time/TimeTagReplaceCommand.test.js +17 -0
- package/dist/time/TimeTestUtil.d.ts +1 -1
- package/dist/time/TimeTestUtil.js +2 -2
- package/dist/time/TimeUrlBuilder.test.d.ts +1 -0
- package/dist/time/TimeUrlBuilder.test.js +46 -0
- package/dist/time/TitleReplaceCommand.test.d.ts +1 -0
- package/dist/time/TitleReplaceCommand.test.js +44 -0
- package/dist/time/datasource/ChronologyReplacer.test.d.ts +1 -0
- package/dist/time/datasource/ChronologyReplacer.test.js +29 -0
- package/dist/time/datasource/CsvMapper.test.d.ts +1 -0
- package/dist/time/datasource/CsvMapper.test.js +50 -0
- package/dist/time/datasource/DatasourceTestCase.d.ts +1 -1
- package/dist/time/datasource/DatasourceTestCase.js +3 -3
- package/dist/time/datasource/FileSource.d.ts +2 -1
- package/dist/time/datasource/FileSource.js +1 -1
- package/dist/time/datasource/JsonMapper.test.d.ts +1 -0
- package/dist/time/datasource/JsonMapper.test.js +23 -0
- package/dist/time/datasource/baseovnifrance/BaseOvniFranceCaseSummaryRR0Mapper.test.d.ts +1 -0
- package/dist/time/datasource/baseovnifrance/BaseOvniFranceCaseSummaryRR0Mapper.test.js +72 -0
- package/dist/time/datasource/baseovnifrance/BaseOvniFranceCsv.test.d.ts +1 -0
- package/dist/time/datasource/baseovnifrance/BaseOvniFranceCsv.test.js +44 -0
- package/dist/time/datasource/baseovnifrance/BaseOvniFranceDatasource.test.d.ts +1 -0
- package/dist/time/datasource/baseovnifrance/BaseOvniFranceDatasource.test.js +30 -0
- package/dist/time/datasource/fufora/FuforaDatasource.test.d.ts +1 -0
- package/dist/time/datasource/fufora/FuforaDatasource.test.js +30 -0
- package/dist/time/datasource/nuforc/NuforcDatasource.test.d.ts +1 -0
- package/dist/time/datasource/nuforc/NuforcDatasource.test.js +30 -0
- package/dist/time/datasource/nuforc/NuforcRR0Mapper.test.d.ts +1 -0
- package/dist/time/datasource/nuforc/NuforcRR0Mapper.test.js +110 -0
- package/dist/time/datasource/rr0/RR0CaseSummary.d.ts +1 -2
- package/dist/time/datasource/rr0/RR0Datasource.test.d.ts +19 -0
- package/dist/time/datasource/rr0/RR0Datasource.test.js +82 -0
- package/dist/time/datasource/rr0/RR0HttpDatasource.d.ts +1 -1
- package/dist/time/datasource/sceau/SceauDatasource.test.d.ts +17 -0
- package/dist/time/datasource/sceau/SceauDatasource.test.js +84 -0
- package/dist/time/datasource/ufo-search/UfoSearchCaseRR0Mapper.js +1 -1
- package/dist/time/datasource/ufo-search/UfoSearchDatasource.test.d.ts +1 -0
- package/dist/time/datasource/ufo-search/UfoSearchDatasource.test.js +30 -0
- package/dist/time/datasource/ufo-search/UfoSearchFileDatasource.js +2 -2
- package/dist/time/datasource/urecat/UrecatDatasource.test.d.ts +1 -0
- package/dist/time/datasource/urecat/UrecatDatasource.test.js +56 -0
- package/dist/time/datasource/urecat/UrecatHttpDatasource.js +1 -1
- package/dist/time/html/TimeRenderer.js +1 -1
- package/dist/time/html/TimeReplacer.test.d.ts +1 -0
- package/dist/time/html/TimeReplacer.test.js +225 -0
- package/dist/time/text/RelativeTimeTextBuilder.js +53 -102
- package/dist/time/text/RelativeTimeTextBuilder.test.d.ts +1 -0
- package/dist/time/text/RelativeTimeTextBuilder.test.js +125 -0
- package/dist/time/text/TimeTextBuilder.d.ts +4 -5
- package/dist/time/text/TimeTextBuilder.js +8 -21
- package/dist/time/text/TimeTextBuilder.test.d.ts +1 -0
- package/dist/time/text/TimeTextBuilder.test.js +63 -0
- package/dist/util/cli/CLI.test.d.ts +1 -0
- package/dist/util/cli/CLI.test.js +13 -0
- package/dist/util/html/HtmlTable.test.d.ts +1 -0
- package/dist/util/html/HtmlTable.test.js +11 -0
- package/dist/util/string/StringUtil.test.d.ts +1 -0
- package/dist/util/string/StringUtil.test.js +22 -0
- package/dist/util/url/UrlUtil.test.d.ts +1 -0
- package/dist/util/url/UrlUtil.test.js +14 -0
- package/package.json +11 -6
- package/dist/build.js +0 -299
- package/dist/data/AbstractDataFactory.d.ts +0 -16
- package/dist/data/AbstractDataFactory.js +0 -60
- package/dist/data/AbstractDataService.d.ts +0 -12
- package/dist/data/AbstractDataService.js +0 -13
- package/dist/data/AllDataService.d.ts +0 -16
- package/dist/data/AllDataService.js +0 -54
- package/dist/data/RR0Data.d.ts +0 -81
- package/dist/data/RR0DataFactory.d.ts +0 -7
- package/dist/data/TypedDataFactory.d.ts +0 -14
- package/dist/data/TypedDataFactory.js +0 -29
- package/dist/data/index.d.ts +0 -6
- package/dist/data/index.js +0 -6
- package/dist/event/RR0Event.d.ts +0 -7
- package/dist/event/RR0EventFactory.d.ts +0 -7
- package/dist/event/RR0EventFactory.js +0 -21
- package/dist/event/index.d.ts +0 -2
- package/dist/event/index.js +0 -2
- package/dist/org/us/region/mn/kalamazoo/KalamazooCities.js +0 -4
- package/dist/org/us/region/mn/kalamazoo/KalamazooCityCode.d.ts +0 -3
- package/dist/org/us/region/mn/kalamazoo/KalamazooCityCode.js +0 -4
- package/dist/org/us/region/mn/kalamazoo/KalamazooMessages_en.d.ts +0 -4
- package/dist/org/us/region/mn/kalamazoo/KalamazooMessages_en.js +0 -6
- package/dist/org/us/region/mn/kalamazoo/KalamazooMessages_fr.d.ts +0 -4
- package/dist/org/us/region/mn/kalamazoo/KalamazooMessages_fr.js +0 -6
- package/dist/org/us/region/mn/kalamazoo/galesburg/Galesburg.js +0 -5
- package/dist/org/us/region/mn/kalamazoo/galesburg/GalesburgMessages.js +0 -2
- package/dist/org/us/region/mo/kalamazoo/KalamazooCities.js +0 -4
- package/dist/org/us/region/mo/kalamazoo/KalamazooCityCode.d.ts +0 -3
- package/dist/org/us/region/mo/kalamazoo/KalamazooCityCode.js +0 -4
- package/dist/org/us/region/mo/kalamazoo/KalamazooMessages_en.d.ts +0 -4
- package/dist/org/us/region/mo/kalamazoo/KalamazooMessages_en.js +0 -6
- package/dist/org/us/region/mo/kalamazoo/KalamazooMessages_fr.d.ts +0 -4
- package/dist/org/us/region/mo/kalamazoo/KalamazooMessages_fr.js +0 -6
- package/dist/org/us/region/mo/kalamazoo/galesburg/Galesburg.d.ts +0 -1
- package/dist/org/us/region/mo/kalamazoo/galesburg/Galesburg.js +0 -5
- package/dist/org/us/region/mo/kalamazoo/galesburg/GalesburgMessages.js +0 -2
- package/dist/org/us/region/ms/kalamazoo/KalamazooCities.js +0 -4
- package/dist/org/us/region/ms/kalamazoo/KalamazooCityCode.d.ts +0 -3
- package/dist/org/us/region/ms/kalamazoo/KalamazooCityCode.js +0 -4
- package/dist/org/us/region/ms/kalamazoo/KalamazooMessages_en.d.ts +0 -4
- package/dist/org/us/region/ms/kalamazoo/KalamazooMessages_en.js +0 -6
- package/dist/org/us/region/ms/kalamazoo/KalamazooMessages_fr.d.ts +0 -4
- package/dist/org/us/region/ms/kalamazoo/KalamazooMessages_fr.js +0 -6
- package/dist/org/us/region/ms/kalamazoo/galesburg/Galesburg.d.ts +0 -1
- package/dist/org/us/region/ms/kalamazoo/galesburg/Galesburg.js +0 -5
- package/dist/org/us/region/mt/kalamazoo/KalamazooCities.js +0 -4
- package/dist/org/us/region/mt/kalamazoo/KalamazooCityCode.d.ts +0 -3
- package/dist/org/us/region/mt/kalamazoo/KalamazooCityCode.js +0 -4
- package/dist/org/us/region/mt/kalamazoo/KalamazooMessages_en.d.ts +0 -4
- package/dist/org/us/region/mt/kalamazoo/KalamazooMessages_en.js +0 -6
- package/dist/org/us/region/mt/kalamazoo/KalamazooMessages_fr.d.ts +0 -4
- package/dist/org/us/region/mt/kalamazoo/KalamazooMessages_fr.js +0 -6
- package/dist/org/us/region/mt/kalamazoo/galesburg/Galesburg.d.ts +0 -1
- package/dist/org/us/region/mt/kalamazoo/galesburg/Galesburg.js +0 -5
- package/dist/org/us/region/mt/kalamazoo/galesburg/GalesburgMessages.js +0 -2
- package/dist/org/us/region/nh/kalamazoo/Kalamazoo.d.ts +0 -2
- package/dist/org/us/region/nh/kalamazoo/KalamazooCities.d.ts +0 -2
- package/dist/org/us/region/nh/kalamazoo/KalamazooCities.js +0 -4
- package/dist/org/us/region/nh/kalamazoo/KalamazooCityCode.d.ts +0 -3
- package/dist/org/us/region/nh/kalamazoo/KalamazooCityCode.js +0 -4
- package/dist/org/us/region/nh/kalamazoo/KalamazooMessages_en.d.ts +0 -4
- package/dist/org/us/region/nh/kalamazoo/KalamazooMessages_en.js +0 -6
- package/dist/org/us/region/nh/kalamazoo/KalamazooMessages_fr.d.ts +0 -4
- package/dist/org/us/region/nh/kalamazoo/KalamazooMessages_fr.js +0 -6
- package/dist/org/us/region/nh/kalamazoo/galesburg/Galesburg.d.ts +0 -1
- package/dist/org/us/region/nh/kalamazoo/galesburg/Galesburg.js +0 -5
- package/dist/org/us/region/nh/kalamazoo/galesburg/GalesburgMessages.d.ts +0 -2
- package/dist/org/us/region/nh/kalamazoo/galesburg/GalesburgMessages.js +0 -2
- package/dist/org/us/region/nv/kalamazoo/Kalamazoo.d.ts +0 -2
- package/dist/org/us/region/nv/kalamazoo/KalamazooCities.d.ts +0 -2
- package/dist/org/us/region/nv/kalamazoo/KalamazooCities.js +0 -4
- package/dist/org/us/region/nv/kalamazoo/KalamazooCityCode.d.ts +0 -3
- package/dist/org/us/region/nv/kalamazoo/KalamazooCityCode.js +0 -4
- package/dist/org/us/region/nv/kalamazoo/KalamazooMessages_en.d.ts +0 -4
- package/dist/org/us/region/nv/kalamazoo/KalamazooMessages_en.js +0 -6
- package/dist/org/us/region/nv/kalamazoo/KalamazooMessages_fr.d.ts +0 -4
- package/dist/org/us/region/nv/kalamazoo/KalamazooMessages_fr.js +0 -6
- package/dist/org/us/region/nv/kalamazoo/galesburg/Galesburg.d.ts +0 -1
- package/dist/org/us/region/nv/kalamazoo/galesburg/Galesburg.js +0 -5
- package/dist/org/us/region/nv/kalamazoo/galesburg/GalesburgMessages.d.ts +0 -2
- package/dist/org/us/region/nv/kalamazoo/galesburg/GalesburgMessages.js +0 -2
- package/dist/source/Article.d.ts +0 -4
- package/dist/source/ArticleFactory.d.ts +0 -7
- package/dist/source/ArticleFactory.js +0 -11
- package/dist/source/Source.d.ts +0 -45
- package/tsconfig.json +0 -23
- package/tsconfig.prod.json +0 -10
- /package/dist/{build.d.ts → OpenGraphCommand.test.d.ts} +0 -0
- /package/dist/{data/RR0Data.js → RR0Build.test.d.ts} +0 -0
- /package/dist/{data/RR0DataFactory.js → anchor/AnchorReplaceCommandTest.d.ts} +0 -0
- /package/dist/{event/RR0Event.js → anchor/AnchorReplacerTest.d.ts} +0 -0
- /package/dist/{source/Article.js → lang/LanguageReplaceCommant.test.d.ts} +0 -0
- /package/dist/{source/Source.js → org/cn/ChinaMessages.js} +0 -0
package/README.md
CHANGED
|
@@ -1,8 +1,26 @@
|
|
|
1
1
|
# RR0 CMS
|
|
2
2
|
|
|
3
|
-
This is
|
|
3
|
+
This is the Content Management System (CMS) used to build the [RR0 website](https://rr0.org).
|
|
4
|
+
|
|
5
|
+
It allows to produce a similar website, but with the data of your choice.
|
|
6
|
+
|
|
7
|
+
It relies on [ssg-api](https://www.npmjs.com/package/ssg-api) to generate the web pages.
|
|
4
8
|
|
|
5
9
|
While it is especially designed to render UFO-related data as it was designed to render the [RR0 website](https://rr0.org),
|
|
6
10
|
it can also probably be used to generate websites pertaining to other topics, as most of the data types (time, place, event, sources, notes, etc.) are not specific to the ufological domain.
|
|
7
11
|
|
|
8
|
-
|
|
12
|
+
```mermaid
|
|
13
|
+
classDiagram
|
|
14
|
+
class cms {
|
|
15
|
+
build()
|
|
16
|
+
}
|
|
17
|
+
cms --> common
|
|
18
|
+
cms --> lang
|
|
19
|
+
cms --> time
|
|
20
|
+
cms --> place
|
|
21
|
+
cms --> org
|
|
22
|
+
cms --> ssg-api
|
|
23
|
+
cms --> data
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
- [Data types](https://github.com/RR0/data?tab=readme-ov-file#rr0data)
|
|
@@ -1,10 +1,8 @@
|
|
|
1
|
-
import { AllDataService } from "./data/AllDataService.js";
|
|
2
1
|
import { TimeElementFactory } from "./time/html/TimeElementFactory.js";
|
|
3
2
|
import { ContentVisitor } from "./RR0ContentStep.js";
|
|
4
3
|
import { HtmlRR0Context } from "./RR0Context.js";
|
|
5
|
-
import { RR0Data } from "./data/RR0Data.js";
|
|
6
4
|
import { EventRenderer } from "./time/EventRenderer.js";
|
|
7
|
-
import { RR0Event } from "
|
|
5
|
+
import { AllDataService, RR0Data, RR0Event } from "@rr0/data";
|
|
8
6
|
export declare class DefaultContentVisitor implements ContentVisitor {
|
|
9
7
|
protected service: AllDataService;
|
|
10
8
|
protected eventRenderer: EventRenderer<RR0Event>;
|
package/dist/OpenGraphCommand.js
CHANGED
|
@@ -56,7 +56,7 @@ export class OpenGraphCommand {
|
|
|
56
56
|
context.time.setDayOfMonth(timeContext.getDayOfMonth());
|
|
57
57
|
context.time.setHour(undefined);
|
|
58
58
|
context.time.setMinutes(undefined);
|
|
59
|
-
timeStr = this.timeTextBuilder.build(context
|
|
59
|
+
timeStr = this.timeTextBuilder.build(context);
|
|
60
60
|
}
|
|
61
61
|
}
|
|
62
62
|
const copyrightStr = context.file.meta.copyright || "RR0.org";
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { OpenGraphCommand } from "./OpenGraphCommand.js";
|
|
2
|
+
import { rr0TestUtil } from "./test/index.js";
|
|
3
|
+
import { describe, expect, test } from "@javarome/testscript";
|
|
4
|
+
import { TimeTextBuilder } from "./time/index.js";
|
|
5
|
+
describe("OpenGraphCommand", () => {
|
|
6
|
+
const outDir = "/out";
|
|
7
|
+
test("time page", () => {
|
|
8
|
+
const timeFile = rr0TestUtil.time.filePath("0/0/6/5/index.html");
|
|
9
|
+
const context = rr0TestUtil.newHtmlContext(timeFile, "");
|
|
10
|
+
const timeTextBuilder = new TimeTextBuilder(rr0TestUtil.intlOptions);
|
|
11
|
+
const command = new OpenGraphCommand(outDir, [context.file.name], "https://rr0.org", timeTextBuilder);
|
|
12
|
+
expect(command.getInfoStr(context)).toBe("Chronologie, RR0.org");
|
|
13
|
+
});
|
|
14
|
+
});
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { TimeServiceOptions } from "./time";
|
|
2
|
+
import { FileWriteConfig } from "ssg-api";
|
|
3
|
+
import { PeopleDirectoryStepOptions } from "./people";
|
|
4
|
+
export interface RR0BuildArgs {
|
|
5
|
+
/**
|
|
6
|
+
* Configuration file
|
|
7
|
+
*/
|
|
8
|
+
config?: string;
|
|
9
|
+
/**
|
|
10
|
+
* If the search index must be regenerated or not.
|
|
11
|
+
* For ex: "pages,sources"
|
|
12
|
+
*/
|
|
13
|
+
reindex?: string[];
|
|
14
|
+
/**
|
|
15
|
+
* Comma-separated list of file patterns to parse as contents.
|
|
16
|
+
*/
|
|
17
|
+
contents?: string[];
|
|
18
|
+
/**
|
|
19
|
+
* Comma-separated list of file patterns to copy to out dir.
|
|
20
|
+
*/
|
|
21
|
+
copies?: string[];
|
|
22
|
+
/**
|
|
23
|
+
* Comma-separated list of file patterns to books to generate TOCs for.
|
|
24
|
+
*/
|
|
25
|
+
books?: string;
|
|
26
|
+
/**
|
|
27
|
+
* Force re-generation even if file has not changed.
|
|
28
|
+
*/
|
|
29
|
+
force?: string;
|
|
30
|
+
}
|
|
31
|
+
export declare class RR0Build {
|
|
32
|
+
protected contentRoots: string[];
|
|
33
|
+
protected copies: string[];
|
|
34
|
+
protected outDir: string;
|
|
35
|
+
protected timeOptions: TimeServiceOptions;
|
|
36
|
+
protected siteBaseUrl: string;
|
|
37
|
+
protected timeFormat: Intl.DateTimeFormatOptions;
|
|
38
|
+
protected timeFiles: string[];
|
|
39
|
+
protected directoryPages: string[];
|
|
40
|
+
protected ufoCaseDirectoryFile: string;
|
|
41
|
+
protected ufoCasesExclusions: string[];
|
|
42
|
+
protected sourceRegistryFileName: string;
|
|
43
|
+
protected directoryExcluded: string[];
|
|
44
|
+
protected directoryOptions: PeopleDirectoryStepOptions;
|
|
45
|
+
config: FileWriteConfig;
|
|
46
|
+
private context;
|
|
47
|
+
private placeService;
|
|
48
|
+
private orgService;
|
|
49
|
+
private timeService;
|
|
50
|
+
private caseFactory;
|
|
51
|
+
private dataService;
|
|
52
|
+
private peopleFactory;
|
|
53
|
+
private timeTextBuilder;
|
|
54
|
+
constructor(contentRoots: string[], copies: string[], outDir: string, locale: string, googleMapsApiKey: string, mail: string, timeOptions: TimeServiceOptions, siteBaseUrl: string, timeFormat: Intl.DateTimeFormatOptions, timeFiles: string[], directoryPages: string[], ufoCaseDirectoryFile: string, ufoCasesExclusions: string[], sourceRegistryFileName: string, directoryExcluded: string[], directoryOptions: PeopleDirectoryStepOptions);
|
|
55
|
+
run(args: RR0BuildArgs): Promise<void>;
|
|
56
|
+
}
|
package/dist/RR0Build.js
ADDED
|
@@ -0,0 +1,253 @@
|
|
|
1
|
+
import path from "path";
|
|
2
|
+
import fs from "fs";
|
|
3
|
+
import { CaseSummaryRenderer, ChronologyReplacerFactory, CsvMapper, EventReplacer, EventReplacerFactory, HttpSource, RR0Mapping, SsiTitleReplaceCommand, Time, TimeElementFactory, TimeLinkDefaultHandler, TimeReplacer, TimeReplacerFactory, TimeService, TimeTextBuilder, TimeUrlBuilder } from "./time";
|
|
4
|
+
import { CaseDirectoryStep, CaseFactory, CaseService } from "./science/index.js";
|
|
5
|
+
import { GooglePlaceService, PlaceReplacerFactory } from "./place/index.js";
|
|
6
|
+
import { OrganizationFactory, OrganizationService } from "./org/index.js";
|
|
7
|
+
import { RR0ContextImpl } from "./RR0Context.js";
|
|
8
|
+
import { HtmlTable } from "./util/index.js";
|
|
9
|
+
import { AngularExpressionReplaceCommand, ClassDomReplaceCommand, CopyStep, DomReplaceCommand, HtAccessToNetlifyConfigReplaceCommand, Ssg, SsiEchoVarReplaceCommand, SsiIfReplaceCommand, SsiIncludeReplaceCommand, SsiLastModifiedReplaceCommand, SsiSetVarReplaceCommand, StringEchoVarReplaceCommand } from "ssg-api";
|
|
10
|
+
import { LanguageReplaceCommand } from "./lang/index.js";
|
|
11
|
+
import { AuthorReplaceCommand, PeopleDirectoryStepFactory, PeopleFactory, PeopleReplacerFactory, PeopleService, WitnessReplacerFactory } from "./people";
|
|
12
|
+
import { PersistentSourceRegistry, SourceFileCounter, SourceIndexStep, SourceRenderer, SourceReplacer, SourceReplacerFactory } from "./source";
|
|
13
|
+
import { NoteFileCounter, NoteRenderer, NoteReplacer, NoteReplacerFactory } from "./note/index.js";
|
|
14
|
+
import { AnchorReplaceCommand, CaseAnchorHandler, DataAnchorHandler } from "./anchor/index.js";
|
|
15
|
+
import { MetaLinkReplaceCommand } from "./MetaLinkReplaceCommand.js";
|
|
16
|
+
import { OutlineReplaceCommand } from "./outline/index.js";
|
|
17
|
+
import { ImageCommand } from "./ImageCommand.js";
|
|
18
|
+
import { SearchIndexStep, SearchVisitor } from "./search/index.js";
|
|
19
|
+
import { BaseReplaceCommand } from "./BaseReplaceCommand.js";
|
|
20
|
+
import { OpenGraphCommand } from "./OpenGraphCommand.js";
|
|
21
|
+
import { DescriptionReplaceCommand } from "./DescriptionReplaceCommand.js";
|
|
22
|
+
import { BookContentVisitor, BookDirectoryStep } from "./book/index.js";
|
|
23
|
+
import { IndexedReplacerFactory } from "./index/IndexedReplacerFactory.js";
|
|
24
|
+
import { APIFactory, CodeReplacerFactory } from "./tech/index.js";
|
|
25
|
+
import { RR0ContentStep } from "./RR0ContentStep.js";
|
|
26
|
+
import { UnitReplaceCommand } from "./value/index.js";
|
|
27
|
+
import { DefaultContentVisitor } from "./DefaultContentVisitor.js";
|
|
28
|
+
import { rr0DefaultCopyright } from "./RR0DefaultCopyright.js";
|
|
29
|
+
import { TimeContext } from "@rr0/time";
|
|
30
|
+
import { writeFile } from "@javarome/fileutil";
|
|
31
|
+
import { AllDataService, RR0EventFactory, TypedDataFactory } from "@rr0/data";
|
|
32
|
+
const outputFunc = async (context, outFile) => {
|
|
33
|
+
try {
|
|
34
|
+
context.file.contents = context.file.serialize();
|
|
35
|
+
context.log("Writing", outFile.name);
|
|
36
|
+
await outFile.write();
|
|
37
|
+
context.file.contents = outFile.contents;
|
|
38
|
+
}
|
|
39
|
+
catch (e) {
|
|
40
|
+
context.error(outFile.name, e);
|
|
41
|
+
}
|
|
42
|
+
};
|
|
43
|
+
export class RR0Build {
|
|
44
|
+
constructor(contentRoots, copies, outDir, locale, googleMapsApiKey, mail, timeOptions, siteBaseUrl, timeFormat, timeFiles, directoryPages, ufoCaseDirectoryFile, ufoCasesExclusions, sourceRegistryFileName, directoryExcluded, directoryOptions) {
|
|
45
|
+
this.contentRoots = contentRoots;
|
|
46
|
+
this.copies = copies;
|
|
47
|
+
this.outDir = outDir;
|
|
48
|
+
this.timeOptions = timeOptions;
|
|
49
|
+
this.siteBaseUrl = siteBaseUrl;
|
|
50
|
+
this.timeFormat = timeFormat;
|
|
51
|
+
this.timeFiles = timeFiles;
|
|
52
|
+
this.directoryPages = directoryPages;
|
|
53
|
+
this.ufoCaseDirectoryFile = ufoCaseDirectoryFile;
|
|
54
|
+
this.ufoCasesExclusions = ufoCasesExclusions;
|
|
55
|
+
this.sourceRegistryFileName = sourceRegistryFileName;
|
|
56
|
+
this.directoryExcluded = directoryExcluded;
|
|
57
|
+
this.directoryOptions = directoryOptions;
|
|
58
|
+
this.config = {
|
|
59
|
+
getOutputPath(context) {
|
|
60
|
+
return path.join(outDir, context.file.name);
|
|
61
|
+
}
|
|
62
|
+
};
|
|
63
|
+
const timeContext = new TimeContext();
|
|
64
|
+
const context = this.context = new RR0ContextImpl(locale, timeContext, this.config);
|
|
65
|
+
context.setVar("mapsApiKey", googleMapsApiKey);
|
|
66
|
+
context.setVar("mail", mail);
|
|
67
|
+
this.placeService = new GooglePlaceService("place", googleMapsApiKey);
|
|
68
|
+
this.orgService = new OrganizationService([], "org", undefined);
|
|
69
|
+
const timeTextBuilder = this.timeTextBuilder = new TimeTextBuilder(timeFormat);
|
|
70
|
+
const timeUrlBuilder = new TimeUrlBuilder({ rootDir: timeOptions.root });
|
|
71
|
+
const eventFactory = new RR0EventFactory();
|
|
72
|
+
const sightingFactory = new TypedDataFactory(eventFactory, "sighting", ["index"]);
|
|
73
|
+
const orgFactory = new OrganizationFactory(eventFactory);
|
|
74
|
+
const caseFactory = this.caseFactory = new CaseFactory(eventFactory);
|
|
75
|
+
const peopleFactory = this.peopleFactory = new PeopleFactory(eventFactory);
|
|
76
|
+
const apiFactory = new APIFactory(eventFactory);
|
|
77
|
+
const bookFactory = new TypedDataFactory(eventFactory, "book");
|
|
78
|
+
const articleFactory = new TypedDataFactory(eventFactory, "article");
|
|
79
|
+
const dataService = this.dataService = new AllDataService([orgFactory, caseFactory, peopleFactory, bookFactory, articleFactory, sightingFactory, apiFactory]);
|
|
80
|
+
dataService.getFromDir("", ["people", "case"]).then(data => {
|
|
81
|
+
console.debug(data);
|
|
82
|
+
});
|
|
83
|
+
this.timeService = new TimeService(dataService, timeTextBuilder, timeUrlBuilder, timeOptions);
|
|
84
|
+
}
|
|
85
|
+
async run(args) {
|
|
86
|
+
const context = this.context;
|
|
87
|
+
const timeFiles = this.timeFiles;
|
|
88
|
+
context.setVar("timeFilesCount", timeFiles.length);
|
|
89
|
+
const timeService = this.timeService;
|
|
90
|
+
const timeElementFactory = new TimeElementFactory(timeService.renderer);
|
|
91
|
+
const timeReplacer = new TimeReplacer(timeElementFactory);
|
|
92
|
+
const caseFiles = await this.caseFactory.getFiles();
|
|
93
|
+
let dataService = this.dataService;
|
|
94
|
+
const caseService = new CaseService(dataService, this.caseFactory, timeElementFactory, caseFiles);
|
|
95
|
+
const peopleFiles = await this.peopleFactory.getFiles();
|
|
96
|
+
const peopleService = new PeopleService(dataService, this.peopleFactory, peopleFiles);
|
|
97
|
+
const peopleList = await peopleService.getAll();
|
|
98
|
+
context.setVar("peopleFilesCount", peopleList.length);
|
|
99
|
+
const bookMeta = new Map();
|
|
100
|
+
const bookLinks = new Map();
|
|
101
|
+
const config = this.config;
|
|
102
|
+
const ufoCasesStep = new CaseDirectoryStep(caseService, caseService.files, this.ufoCasesExclusions, this.ufoCaseDirectoryFile, outputFunc, config);
|
|
103
|
+
const peopleDirectoryFactory = new PeopleDirectoryStepFactory(outputFunc, config, peopleService, this.directoryExcluded);
|
|
104
|
+
const peopleSteps = await peopleDirectoryFactory.create(this.directoryOptions);
|
|
105
|
+
// Publish case.json files so that vraiufo.com will find them
|
|
106
|
+
const copies = this.copies;
|
|
107
|
+
copies.push(...(ufoCasesStep.config.rootDirs).map(dir => path.join(dir, "case.json")));
|
|
108
|
+
const outDir = this.outDir;
|
|
109
|
+
await writeFile(path.join(outDir, "casesDirs.json"), JSON.stringify(ufoCasesStep.config.rootDirs), "utf-8");
|
|
110
|
+
copies.push(...(peopleSteps.reduce((rootDirs, peopleStep) => {
|
|
111
|
+
rootDirs.push(...peopleStep.config.rootDirs);
|
|
112
|
+
return rootDirs;
|
|
113
|
+
}, [])).map(dir => path.join(dir, "people.json")));
|
|
114
|
+
await writeFile(path.join(outDir, "peopleDirs.json"), JSON.stringify(peopleList.map(people => people.dirName)), "utf-8");
|
|
115
|
+
const timeTextBuilder = this.timeTextBuilder;
|
|
116
|
+
const searchVisitor = new SearchVisitor({ notIndexedUrls: ["404.html", "Referencement.html"], indexWords: false }, timeTextBuilder);
|
|
117
|
+
const sourceRenderer = new SourceRenderer(timeTextBuilder);
|
|
118
|
+
const http = new HttpSource();
|
|
119
|
+
const baseUrl = this.siteBaseUrl;
|
|
120
|
+
const timeFormat = this.timeFormat;
|
|
121
|
+
const sourceFactory = new PersistentSourceRegistry(dataService, http, baseUrl, this.sourceRegistryFileName, timeFormat);
|
|
122
|
+
const noteCounter = new NoteFileCounter();
|
|
123
|
+
const noteRenderer = new NoteRenderer(noteCounter);
|
|
124
|
+
const caseRenderer = new CaseSummaryRenderer(noteRenderer, sourceFactory, sourceRenderer, timeElementFactory);
|
|
125
|
+
// const actions: ChronologyReplacerActions = {read: ["backup", "fetch"], write: ["backup", "pages"]}
|
|
126
|
+
// const actions: ChronologyReplacerActions = {read: [], write: ["backup"]}
|
|
127
|
+
const actions = { read: ["fetch"], write: ["backup"] };
|
|
128
|
+
const rr0Mapping = new RR0Mapping(actions);
|
|
129
|
+
const databaseAggregationCommand = new DomReplaceCommand(".contents ul", new ChronologyReplacerFactory(timeService, [rr0Mapping /*new GeipanRR0Mapping(actions)
|
|
130
|
+
/*, baseOvniFranceRR0Mapping, fuforaRR0Mapping, nuforcRR0Mapping, urecatRR0Mapping*/
|
|
131
|
+
], caseRenderer));
|
|
132
|
+
const timeDefaultHandler = (context) => {
|
|
133
|
+
let title;
|
|
134
|
+
title = Time.titleFromFile(context, context.file.name, timeTextBuilder);
|
|
135
|
+
return title;
|
|
136
|
+
};
|
|
137
|
+
const pageReplaceCommands = [
|
|
138
|
+
new BaseReplaceCommand("/"),
|
|
139
|
+
new LanguageReplaceCommand(),
|
|
140
|
+
new SsiEchoVarReplaceCommand("copyright", [rr0DefaultCopyright]),
|
|
141
|
+
new StringEchoVarReplaceCommand(),
|
|
142
|
+
new AngularExpressionReplaceCommand(),
|
|
143
|
+
new SsiIfReplaceCommand(),
|
|
144
|
+
new SsiSetVarReplaceCommand("title", (_match, ...args) => `<title>${args[0]}</title>`),
|
|
145
|
+
new SsiSetVarReplaceCommand("url", (_match, ...args) => `<meta name="url" content="${args[0]}"/>`),
|
|
146
|
+
new SsiLastModifiedReplaceCommand(timeFormat),
|
|
147
|
+
new SsiTitleReplaceCommand([timeDefaultHandler]),
|
|
148
|
+
new DescriptionReplaceCommand("UFO data for french-reading people", "abstract"),
|
|
149
|
+
new AuthorReplaceCommand(timeService)
|
|
150
|
+
];
|
|
151
|
+
const sourceCounter = new SourceFileCounter();
|
|
152
|
+
const sourceReplacer = new SourceReplacer(sourceRenderer, sourceFactory, sourceCounter);
|
|
153
|
+
const sourceReplacerFactory = new SourceReplacerFactory(sourceReplacer);
|
|
154
|
+
const noteReplacer = new NoteReplacer(noteRenderer);
|
|
155
|
+
const noteReplacerFactory = new NoteReplacerFactory(noteReplacer);
|
|
156
|
+
const eventReplacer = new EventReplacer(caseRenderer, dataService);
|
|
157
|
+
const contentsReplaceCommand = [
|
|
158
|
+
new ClassDomReplaceCommand(new EventReplacerFactory(eventReplacer), "event"),
|
|
159
|
+
new ClassDomReplaceCommand(sourceReplacerFactory, "source"),
|
|
160
|
+
new DomReplaceCommand("time", new TimeReplacerFactory(timeReplacer)),
|
|
161
|
+
new DomReplaceCommand("code", new CodeReplacerFactory()),
|
|
162
|
+
new ClassDomReplaceCommand(new PeopleReplacerFactory(peopleService), "people"),
|
|
163
|
+
new ClassDomReplaceCommand(new PlaceReplacerFactory(), "place"),
|
|
164
|
+
new ClassDomReplaceCommand(new WitnessReplacerFactory(), "temoin", "temoin1", "temoin2", "temoin3"),
|
|
165
|
+
new ClassDomReplaceCommand(noteReplacerFactory, "note"),
|
|
166
|
+
new ClassDomReplaceCommand(new IndexedReplacerFactory(), "indexed"),
|
|
167
|
+
new UnitReplaceCommand(),
|
|
168
|
+
new MetaLinkReplaceCommand(new TimeLinkDefaultHandler(timeService, timeTextBuilder)),
|
|
169
|
+
databaseAggregationCommand
|
|
170
|
+
];
|
|
171
|
+
const ssg = new Ssg(config);
|
|
172
|
+
const getOutputPath = (context) => path.join(outDir, context.file.name);
|
|
173
|
+
const force = args.force === "true";
|
|
174
|
+
const toProcess = new Set(this.directoryPages);
|
|
175
|
+
const csvTransformer = new class {
|
|
176
|
+
transform(context, file) {
|
|
177
|
+
const fileName = file.name;
|
|
178
|
+
if (!fileName.endsWith(".csv")) {
|
|
179
|
+
return undefined;
|
|
180
|
+
}
|
|
181
|
+
const csv = fs.readFileSync(fileName, { encoding: "utf-8" });
|
|
182
|
+
const headers = [];
|
|
183
|
+
const obj = new CsvMapper().parse(csv, headers);
|
|
184
|
+
return HtmlTable.create(obj, headers);
|
|
185
|
+
}
|
|
186
|
+
}();
|
|
187
|
+
const htAccessToNetlifyConfig = {
|
|
188
|
+
replacements: [new HtAccessToNetlifyConfigReplaceCommand(baseUrl)],
|
|
189
|
+
roots: [".htaccess"],
|
|
190
|
+
getOutputPath(_context) {
|
|
191
|
+
return path.join(this.outDir, "netlify.toml");
|
|
192
|
+
}
|
|
193
|
+
};
|
|
194
|
+
const contentRoots = this.contentRoots;
|
|
195
|
+
const includeStep = new RR0ContentStep([htAccessToNetlifyConfig, {
|
|
196
|
+
roots: contentRoots,
|
|
197
|
+
replacements: [new SsiIncludeReplaceCommand([csvTransformer])],
|
|
198
|
+
getOutputPath
|
|
199
|
+
}], outputFunc, [], [], force, "content includes", toProcess);
|
|
200
|
+
ssg.add(includeStep);
|
|
201
|
+
ssg.add(ufoCasesStep);
|
|
202
|
+
ssg.add(...peopleSteps);
|
|
203
|
+
if (contentRoots) {
|
|
204
|
+
const contentVisitor = new DefaultContentVisitor(dataService, caseRenderer, timeElementFactory);
|
|
205
|
+
const contentVisitors = [contentVisitor, searchVisitor];
|
|
206
|
+
if (args.books) {
|
|
207
|
+
contentVisitors.push(new BookContentVisitor(bookMeta, bookLinks));
|
|
208
|
+
}
|
|
209
|
+
const contentReplacements = [
|
|
210
|
+
...pageReplaceCommands,
|
|
211
|
+
...contentsReplaceCommand,
|
|
212
|
+
new OutlineReplaceCommand(),
|
|
213
|
+
new AnchorReplaceCommand(baseUrl, [new CaseAnchorHandler(caseService, timeTextBuilder), new DataAnchorHandler(dataService)]),
|
|
214
|
+
new ImageCommand(outDir, 275, 500),
|
|
215
|
+
new OpenGraphCommand(outDir, timeFiles, baseUrl, timeTextBuilder)
|
|
216
|
+
];
|
|
217
|
+
ssg.add(new RR0ContentStep([{ roots: contentRoots, replacements: contentReplacements, getOutputPath }], outputFunc, [], contentVisitors, force, "contents replacements", toProcess));
|
|
218
|
+
}
|
|
219
|
+
if (args.books) {
|
|
220
|
+
ssg.add(await BookDirectoryStep.create(outputFunc, config, bookMeta, bookLinks));
|
|
221
|
+
}
|
|
222
|
+
const reindex = args.reindex;
|
|
223
|
+
if (reindex === null || reindex === void 0 ? void 0 : reindex.includes("search")) {
|
|
224
|
+
ssg.add(new SearchIndexStep("search/index.json", searchVisitor));
|
|
225
|
+
}
|
|
226
|
+
if (reindex === null || reindex === void 0 ? void 0 : reindex.includes("sources")) {
|
|
227
|
+
ssg.add(new SourceIndexStep(this.sourceRegistryFileName, sourceFactory));
|
|
228
|
+
}
|
|
229
|
+
if (copies) {
|
|
230
|
+
const copyConfig = {
|
|
231
|
+
getOutputPath,
|
|
232
|
+
sourcePatterns: copies,
|
|
233
|
+
options: { ignore: ["node_modules/**", "out/**"] }
|
|
234
|
+
};
|
|
235
|
+
ssg.add(new CopyStep(copyConfig));
|
|
236
|
+
}
|
|
237
|
+
try {
|
|
238
|
+
const result = await ssg.start(context);
|
|
239
|
+
context.log("Completed", result);
|
|
240
|
+
}
|
|
241
|
+
catch (err) {
|
|
242
|
+
try {
|
|
243
|
+
context.error(err, context.file.name);
|
|
244
|
+
}
|
|
245
|
+
catch (e) {
|
|
246
|
+
context.error(err);
|
|
247
|
+
}
|
|
248
|
+
}
|
|
249
|
+
finally {
|
|
250
|
+
console.timeEnd("ssg");
|
|
251
|
+
}
|
|
252
|
+
}
|
|
253
|
+
}
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
import path from "path";
|
|
2
|
+
import { glob } from "glob";
|
|
3
|
+
import { describe } from "@javarome/testscript";
|
|
4
|
+
import { FileContents } from "@javarome/fileutil";
|
|
5
|
+
import { CLI } from "./util/index.js";
|
|
6
|
+
import { RR0Build } from "./RR0Build.js";
|
|
7
|
+
import { rr0TestUtil } from "./test";
|
|
8
|
+
function testFilePath(filePath) {
|
|
9
|
+
return path.join(rr0TestUtil.rootDir, filePath);
|
|
10
|
+
}
|
|
11
|
+
describe("Build", () => {
|
|
12
|
+
console.time("ssg");
|
|
13
|
+
let args = new CLI().getArgs();
|
|
14
|
+
const configFile = args.config;
|
|
15
|
+
if (configFile) {
|
|
16
|
+
args = JSON.parse(FileContents.read(configFile).contents);
|
|
17
|
+
}
|
|
18
|
+
const cliContents = args.contents;
|
|
19
|
+
console.debug("contents", cliContents);
|
|
20
|
+
const mandatoryRoots = ["people/*.html", "science/crypto/ufo/enquete/dossier/*.html"];
|
|
21
|
+
const contentRoots = cliContents
|
|
22
|
+
? cliContents.concat(mandatoryRoots)
|
|
23
|
+
: [
|
|
24
|
+
"croyance/**/*.html",
|
|
25
|
+
"index.html", "404.html", "googlebe03dcf00678bb7c.html", "Contact.html", "Copyright.html", "preambule.html", "FAQ.html", "Referencement.html",
|
|
26
|
+
"time/**/*.html",
|
|
27
|
+
"book/**/*.html",
|
|
28
|
+
"droit/**/*.html",
|
|
29
|
+
"org/**/*.html",
|
|
30
|
+
"people/**/*.html",
|
|
31
|
+
"place/**/*.html",
|
|
32
|
+
"politique/**/*.html",
|
|
33
|
+
"science/**/*.html",
|
|
34
|
+
"tech/**/*.html",
|
|
35
|
+
"udb/*.html",
|
|
36
|
+
"js/**/*.html"
|
|
37
|
+
];
|
|
38
|
+
const copiesArg = args.copies;
|
|
39
|
+
const copies = copiesArg ? copiesArg : [
|
|
40
|
+
"favicon.ico", "manifest.json", "opensearch.xml", "apple-touch-icon.png", "apple-touch-icon_400x400.png", "screenshot1.jpg",
|
|
41
|
+
"rr0.css", "map.css", "diagram.css", "print.css", "figure.css", "section.css", "table.css", "nav.css",
|
|
42
|
+
// "**/*.png", "**/*.jpg", "**/*.gif", "**/*.webp", "!out/**/*",
|
|
43
|
+
"**/*.cmmn", "**/*.bpmn",
|
|
44
|
+
"tech/info/soft/reseau/protocole/index.js", "tech/info/soft/reseau/protocole/ports.json", "tech/info/soft/reseau/protocole/index.css",
|
|
45
|
+
"tech/info/soft/data/doc/index.js", "tech/info/soft/data/doc/index.json", "tech/info/soft/data/doc/index.css",
|
|
46
|
+
"people/index.js", "people/index.css", "people/witness/index.css",
|
|
47
|
+
"search/SearchComponent.mjs", "search/index.json", "search/search.css",
|
|
48
|
+
"source/index.css", "note/index.css",
|
|
49
|
+
"link.css", "quote.css",
|
|
50
|
+
"time/DualRangeComponent.mjs",
|
|
51
|
+
"index/index.js", "lang/form.js", "lang/form.css", "lang/speech.js", "lang/speech.css",
|
|
52
|
+
"croyance/divin/theisme/mono/livre/islam/coran/index.js"
|
|
53
|
+
].map(testFilePath);
|
|
54
|
+
const outDir = "out";
|
|
55
|
+
const googleMapsApiKey = process.env.GOOGLE_MAPS_API_KEY;
|
|
56
|
+
if (!googleMapsApiKey) {
|
|
57
|
+
throw Error("GOOGLE_MAPS_API_KEY is required");
|
|
58
|
+
}
|
|
59
|
+
const timeOptions = {
|
|
60
|
+
root: testFilePath("time"),
|
|
61
|
+
files: []
|
|
62
|
+
};
|
|
63
|
+
const timeFormat = {
|
|
64
|
+
year: "numeric",
|
|
65
|
+
month: "long",
|
|
66
|
+
day: "numeric",
|
|
67
|
+
weekday: "long",
|
|
68
|
+
hour: "2-digit",
|
|
69
|
+
minute: "2-digit"
|
|
70
|
+
};
|
|
71
|
+
async function getTimeFiles() {
|
|
72
|
+
const minusYearFiles = await glob("time/-?/?/?/?/index.html");
|
|
73
|
+
const year1Files = await glob("time/?/index.html");
|
|
74
|
+
const year2Files = await glob("time/?/?/index.html");
|
|
75
|
+
const year3Files = await glob("time/?/?/?/index.html");
|
|
76
|
+
const year4Files = await glob("time/?/?/?/?/index.html");
|
|
77
|
+
const monthFiles = await glob("time/?/?/?/?/??/index.html");
|
|
78
|
+
const dayFiles = await glob("time/?/?/?/?/??/??/index.html");
|
|
79
|
+
return year1Files.concat(year2Files).concat(year3Files).concat(year4Files).concat(minusYearFiles).concat(monthFiles).concat(dayFiles).sort();
|
|
80
|
+
}
|
|
81
|
+
const directoryPages = [
|
|
82
|
+
"people/index.html", "people/witness/index.html", "people/militaires.html", "people/scientifiques.html",
|
|
83
|
+
"people/astronomes.html", "people/politicians.html", "people/dirigeants.html", "people/pilotes.html",
|
|
84
|
+
"people/contactes.html", "people/ufologues.html", "tech/info/Personnes.html", "people/Contributeurs.html"
|
|
85
|
+
].map(testFilePath);
|
|
86
|
+
getTimeFiles().then(async (timeFiles) => {
|
|
87
|
+
const directoryOptions = {
|
|
88
|
+
root: testFilePath("people/index.html"),
|
|
89
|
+
scientists: testFilePath("people/scientifiques.html"),
|
|
90
|
+
ufologists: testFilePath("people/ufologues.html"),
|
|
91
|
+
ufoWitnesses: testFilePath("people/witness/index.html"),
|
|
92
|
+
astronomers: testFilePath("people/astronomes.html"),
|
|
93
|
+
contactees: testFilePath("people/contactes.html"),
|
|
94
|
+
pilots: testFilePath("people/pilotes.html"),
|
|
95
|
+
military: testFilePath("people/militaires.html"),
|
|
96
|
+
softwareEngineers: testFilePath("tech/info/Personnes.html"),
|
|
97
|
+
politicians: testFilePath("people/politicians.html"),
|
|
98
|
+
rulers: testFilePath("people/dirigeants.html")
|
|
99
|
+
};
|
|
100
|
+
const sourceRegistryFileName = testFilePath("source/index.json");
|
|
101
|
+
const siteBaseUrl = "https://rr0.org/";
|
|
102
|
+
const mail = "rr0@rr0.org";
|
|
103
|
+
const build = new RR0Build(contentRoots, copies, outDir, "fr", googleMapsApiKey, mail, timeOptions, siteBaseUrl, timeFormat, timeFiles, directoryPages, testFilePath("science/crypto/ufo/enquete/dossier/index.html"), [testFilePath("science/crypto/ufo/enquete/dossier/canular")], sourceRegistryFileName, ["people/Astronomers_fichiers", "people/witness", "people/author"], directoryOptions);
|
|
104
|
+
await build.run(args);
|
|
105
|
+
});
|
|
106
|
+
});
|
package/dist/RR0Context.d.ts
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { RR0Messages } from "./lang/index.js";
|
|
2
|
-
import {
|
|
2
|
+
import { FileWriteConfig, HtmlSsgContext, SsgContext, SsgContextImpl } from "ssg-api";
|
|
3
3
|
import { People } from "./people/People.js";
|
|
4
4
|
import { TimeContext } from "@rr0/time";
|
|
5
|
+
import { FileContents } from "@javarome/fileutil";
|
|
5
6
|
export interface RR0Context extends SsgContext {
|
|
6
7
|
readonly messages: RR0Messages;
|
|
7
8
|
readonly time: TimeContext;
|
|
@@ -12,17 +13,18 @@ export interface HtmlRR0Context extends HtmlSsgContext {
|
|
|
12
13
|
time: TimeContext;
|
|
13
14
|
people: People;
|
|
14
15
|
readonly images: Set<string>;
|
|
15
|
-
readonly config:
|
|
16
|
+
readonly config: FileWriteConfig;
|
|
16
17
|
clone(locale?: string): HtmlRR0Context;
|
|
17
18
|
}
|
|
18
19
|
export declare class RR0ContextImpl extends SsgContextImpl {
|
|
19
20
|
readonly time: TimeContext;
|
|
20
|
-
readonly config:
|
|
21
|
+
readonly config: FileWriteConfig;
|
|
21
22
|
readonly people: any;
|
|
22
23
|
readonly messages: RR0Messages;
|
|
23
24
|
readonly images: Set<string>;
|
|
24
25
|
protected readonly fileMap: Map<string, FileContents>;
|
|
25
|
-
constructor(locale: string, time: TimeContext, config:
|
|
26
|
+
constructor(locale: string, time: TimeContext, config: FileWriteConfig, people?: any, currentFile?: FileContents | undefined, messages?: RR0Messages);
|
|
26
27
|
read(filePath: string): FileContents;
|
|
27
28
|
clone(locale?: string): RR0ContextImpl;
|
|
29
|
+
toString(): string;
|
|
28
30
|
}
|
package/dist/RR0Context.js
CHANGED
|
@@ -26,4 +26,8 @@ export class RR0ContextImpl extends SsgContextImpl {
|
|
|
26
26
|
var _a;
|
|
27
27
|
return new RR0ContextImpl(locale, this.time.clone(), this.config, (_a = this.people) === null || _a === void 0 ? void 0 : _a.clone(), this._file);
|
|
28
28
|
}
|
|
29
|
+
toString() {
|
|
30
|
+
var _a;
|
|
31
|
+
return ((_a = this.time) === null || _a === void 0 ? void 0 : _a.toString()) || "";
|
|
32
|
+
}
|
|
29
33
|
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import path from "path";
|
|
2
|
-
import {
|
|
2
|
+
import { RegexReplaceCommand } from "ssg-api";
|
|
3
|
+
import { FileContents } from "@javarome/fileutil";
|
|
3
4
|
/**
|
|
4
5
|
* Replaces SSI's `<!-- #include virtual="myFileName" -->` by fileName's contents.
|
|
5
6
|
*/
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { AnchorReplaceCommand } from "./AnchorReplaceCommand.js";
|
|
2
|
+
import { rr0TestUtil } from "../test/index.js";
|
|
3
|
+
import { describe, expect, test } from "@javarome/testscript";
|
|
4
|
+
import { CaseAnchorHandler } from "./CaseAnchorHandler.js";
|
|
5
|
+
import { CaseService } from "../science/index.js";
|
|
6
|
+
import { TimeElementFactory, TimeRenderer, TimeTextBuilder } from "../time/index.js";
|
|
7
|
+
import path from "path";
|
|
8
|
+
describe("AnchorReplaceCommand", () => {
|
|
9
|
+
test("replace anchor tag", async () => {
|
|
10
|
+
const dataService = rr0TestUtil.dataService;
|
|
11
|
+
const timeService = rr0TestUtil.time.getService();
|
|
12
|
+
const timeTextBuilder = new TimeTextBuilder(rr0TestUtil.intlOptions);
|
|
13
|
+
const timeRenderer = new TimeRenderer(timeService, timeTextBuilder);
|
|
14
|
+
const timeElementFactory = new TimeElementFactory(timeRenderer);
|
|
15
|
+
const roswellUrl = "/src/science/crypto/ufo/enquete/dossier/Roswell";
|
|
16
|
+
const caseFiles = [path.join(roswellUrl, "index.html")];
|
|
17
|
+
const caseService = new CaseService(dataService, rr0TestUtil.caseFactory, timeElementFactory, caseFiles);
|
|
18
|
+
const command = new AnchorReplaceCommand("https://rr0.org/", [new CaseAnchorHandler(caseService, timeTextBuilder)]);
|
|
19
|
+
const context = rr0TestUtil.time.newHtmlContext("1/9/9/0/08/index.html", `<time>2004</time> <a href="${roswellUrl}">Roswell</a>`);
|
|
20
|
+
await command.execute(context);
|
|
21
|
+
expect(context.file.contents).toBe(`<html><head></head><body><time>2004</time> <a href="/src/science/crypto/ufo/enquete/dossier/Roswell/">Roswell</a></body></html>`);
|
|
22
|
+
});
|
|
23
|
+
});
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import { AnchorReplacer } from "./AnchorReplacer.js";
|
|
2
|
+
import { rr0TestUtil } from "../test/index.js";
|
|
3
|
+
import { JSDOM } from "jsdom";
|
|
4
|
+
import { beforeEach, describe, expect, test } from "@javarome/testscript";
|
|
5
|
+
describe("AnchorReplacer", () => {
|
|
6
|
+
let document;
|
|
7
|
+
beforeEach(async () => {
|
|
8
|
+
document = new JSDOM().window.document;
|
|
9
|
+
});
|
|
10
|
+
test("parse relative internal url", async () => {
|
|
11
|
+
const context = rr0TestUtil.newHtmlContext("science/crypto/ufo/enquete/dossier", "");
|
|
12
|
+
const replacer = new AnchorReplacer("https://rr0.org/", []);
|
|
13
|
+
const a = document.createElement("a");
|
|
14
|
+
a.href = "Roswell";
|
|
15
|
+
a.textContent = "Roswell";
|
|
16
|
+
const replaced = (await replacer.replacement(context, a));
|
|
17
|
+
expect(replaced.target).toBe("");
|
|
18
|
+
expect(replaced.href).toBe("Roswell/");
|
|
19
|
+
});
|
|
20
|
+
test("parse absolute internal file", async () => {
|
|
21
|
+
const context = rr0TestUtil.newHtmlContext("science/crypto/ufo/enquete/dossier", "");
|
|
22
|
+
const replacer = new AnchorReplacer("https://rr0.org/", []);
|
|
23
|
+
const a = document.createElement("a");
|
|
24
|
+
a.href = "/Contact.html";
|
|
25
|
+
a.textContent = "Contact";
|
|
26
|
+
const replaced = (await replacer.replacement(context, a));
|
|
27
|
+
expect(replaced.target).toBe("");
|
|
28
|
+
expect(replaced.href).toBe("/Contact.html");
|
|
29
|
+
});
|
|
30
|
+
test("parse absolute internal url", async () => {
|
|
31
|
+
const context = rr0TestUtil.newHtmlContext("science/crypto/ufo/enquete/dossier", "");
|
|
32
|
+
const replacer = new AnchorReplacer("https://rr0.org/", []);
|
|
33
|
+
const a = document.createElement("a");
|
|
34
|
+
a.href = "/time/pluies";
|
|
35
|
+
a.textContent = "pluies";
|
|
36
|
+
const replaced = (await replacer.replacement(context, a));
|
|
37
|
+
expect(replaced.target).toBe("");
|
|
38
|
+
expect(replaced.href).toBe("/time/pluies/");
|
|
39
|
+
});
|
|
40
|
+
test("parse absolute external url", async () => {
|
|
41
|
+
const context = rr0TestUtil.newHtmlContext("science/crypto/ufo/enquete/dossier", "");
|
|
42
|
+
const replacer = new AnchorReplacer("https://rr0.org/", []);
|
|
43
|
+
const a = document.createElement("a");
|
|
44
|
+
a.href = "https://wikipedia.org";
|
|
45
|
+
a.textContent = "Wikipedia";
|
|
46
|
+
const replaced = (await replacer.replacement(context, a));
|
|
47
|
+
expect(replaced.target).toBe("_blank");
|
|
48
|
+
expect(replaced.href).toBe("https://wikipedia.org/");
|
|
49
|
+
});
|
|
50
|
+
test("parse url with anchor", async () => {
|
|
51
|
+
const context = rr0TestUtil.newHtmlContext("science/crypto/ufo/enquete/dossier", "");
|
|
52
|
+
const replacer = new AnchorReplacer("https://rr0.org/", []);
|
|
53
|
+
const a = document.createElement("a");
|
|
54
|
+
a.href = "enquete/dossier/11Septembre/WTC/crashes#passeport";
|
|
55
|
+
a.textContent = "Passeports";
|
|
56
|
+
const replaced = (await replacer.replacement(context, a));
|
|
57
|
+
expect(replaced.href).toBe("enquete/dossier/11Septembre/WTC/crashes#passeport");
|
|
58
|
+
expect(replaced.target).toBe("");
|
|
59
|
+
});
|
|
60
|
+
});
|
|
@@ -31,7 +31,7 @@ export class CaseAnchorHandler {
|
|
|
31
31
|
else if (!titles.includes(timeStr)) {
|
|
32
32
|
caseContext.time.updateFromStr(timeStr);
|
|
33
33
|
}
|
|
34
|
-
titles.push(this.timeTextBuilder.build(caseContext
|
|
34
|
+
titles.push(this.timeTextBuilder.build(caseContext));
|
|
35
35
|
}
|
|
36
36
|
const place = aCase.place;
|
|
37
37
|
if (typeof place === "string" && !titles.includes(place)) {
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { AnchorHandler } from "./AnchorHandler.js";
|
|
2
2
|
import { HtmlRR0Context } from "RR0Context.js";
|
|
3
|
-
import { AllDataService } from "
|
|
4
|
-
import { RR0Data } from "../data/RR0Data.js";
|
|
3
|
+
import { AllDataService, RR0Data } from "@rr0/data";
|
|
5
4
|
export declare class DataAnchorHandler implements AnchorHandler {
|
|
6
5
|
protected dataService: AllDataService;
|
|
7
6
|
/**
|
package/dist/book/Book.d.ts
CHANGED