npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

tc-source-content-updater

v1.4.32

Published

Module that updates source content for the desktop application translationCore.

Downloads

675

Readme

tc-source-content-updater

Build Status npm npm

Module that updates source content for the desktop application translationCore.

Development

Use the separate helper files (as best you can) for each story.

Some functionality will most likely have to change in the main index as well, but try to keep as much logic as possible in individual helpers.

Parsers can expect the catalog to be fetched before their method is called. It will be under the catalog property of the Updater object

Please try and cleary define your input and output parameter structures so to make collaboration easier

Check __tests__/fixtures/catalog.json for example metadata return from DCS

Usage

To use this module you must first create a new instance of the object. i.e.

//es6
import updater from 'tc-source-content-updater';
const Updater = new updater();

//commonjs
const updater = require('tc-source-content-updater').default;
const Updater = new updater();

Note: In order to limit the amount of API calls the door43 repo, the Updater object uses the same catalog resource throughout its lifetime, without having to continuosly do requests to door43 API on each function call.

Workflow

  1. Create instance
  2. Fetch latest resources
  3. Download the resources that are not updated

Updater Object

getLatestResources(localResourceList):

  • Description Used to initiate a load of the latest resource so that the user can then select which ones they would like to update. Note: This function only returns the resources that are not up to date on the user machine before the request
  • @param {boolean} localResourceList - list of resources that are on the users local machine already
  • @return {Promise} - Array of languages that have updates in catalog (returns null on error)

updateCatalog():

  • description - Method to manually fetch the latest catalog for the current Updater instance. This function has no return value

downloadResources(resourceList):

  • description - Downloads the resources from the specified list using the DCS API
  • @param {Array} resourceList - list of resources that you would like to download
  • @return {Promise} Promise that resolves to success or rejects if a resource failed to download

parseBiblePackage(resourceEntry, extractedFilesPath, resultsPath):

  • description - Parses the bible package to generate json bible contents, manifest, and index
  • @param {String} extractedFilesPath - path to unzipped files from bible package
  • @param {String} resultsPath - path to store processed bible
  • @return {Boolean} true if success

processTranslationAcademy(extractedFilesPath, outputPath):

  • description - Processes the extracted files for translationAcademy to create a single file for each article
  • @param {String} extractedFilesPath - Path to the extracted files that came from the zip file in the catalog
  • @param {String} outputPath - Path to place the processed files WITHOUT version in the path
  • @return {String} The path to the processed translationAcademy files with version

processTranslationWords(extractedFilesPath, outputPath):

  • description - Processes the extracted files for translationWord to cerate the folder structure and produce the index.js file for the language with the title of each article.
  • @param {String} extractedFilesPath - Path to the extracted files that came from the zip file from the catalog
  • @param {String} outputPath - Path to place the processed resource files WIHTOUT the version in the path
  • @return {String} Path to the processed translationWords files with version

generateTwGroupDataFromAlignedBible(biblePath, outputPath):

  • description - Generates the tW Group Data files from the given aligned Bible
  • @param {string} biblePath Path to the Bible with aligned data
  • @param {string} outputPath Path where the translationWords group data is to be placed WITHOUT version
  • @return {string} Path where tW was generated with version

Testing your changes without publishing new version

  • Create your feature/bugfix/enhancement (my-feature-branch)branch off of master.
  • Make your changes in the new branch (my-feature-branch).
  • Push your changes.
  • Run npm i translationCoreApps/tc-source-content-updater#my-feature-branch in your translationCore root directory.
  • Run rm -rf node_modules/tc-source-content-updater; npm i tc-source-content-updater; to get subsequent changes.