deploy page-object data and pattern files
npm install page-deploy
|5||downloads in the last week|
|5||downloads in the last month|
|Version||0.1.4 last updated a month ago|
|Dependencies (8)||node-fs, objobjwalk, pathpublic, highlight.js, marked, wrench, glob, optimist|
NOT FOR PRODUCTION USE -ALPHA QUALITY
It deploys page-object data and pattern files. This is most useful for web applications using locale and language specific data.
For example, your application may use locale files to render an input for a social-security-number. Locale files would describe the input for 'en-US', but not for 'es-ES', while language files would describe a label for the input, such as 'ssn number:' or 'ssn numero:'.
Page-deploy strategically organizes these files for deployment. This positively affects the way you test, deploy, translate and develop an application using such files.
Any file-deployment tool relies on input files being organised in some way. I have worked on applications built around poorly organised input files. I have studied the organisation of International files by Ruby on Rails, Django, Microsoft, Jquery, Mozilla, Apple and by the Unicode Consortium. This tool is a product of that experience.
Decisions made by this software:
- JSON as the primary data format.
- Join files around subjects they describe.
- Separate locale files from language files.
- Separate descriptive rules from data definitions.
- Separate files from any subject platform or codebase.
- Define data in two ways only: element, array of elements.
- No Config File
Web applications require some control over the number of requests needed to obtain data and the size of that data. To allow control, some data should be available as both an element and an array of elements. One source only should exist for that data.
getStarted is provided with page-deploy. Its layout and file-naming scheme are supported. A full layout of the directory with the
$ tree -L 10 ./getStarted/convert ...
The example shows files grouped by 'defaults', 'data' and 'page-object'. Another* grouping could be used. The grouping used in the example is recommended.
Ruby on Rails groups data by 'models' and 'views'.
ISO 639-2 represents all languages contained in ISO 639-1 and in addition any other language as well as language groups as they may be coded for special purposes [...] every language code in the two-letter code set has a corresponding language code in the alpha-3 list, but not necessarily vice versa.
Examples also use naming conventions copied from Apple. 'ES' designates the locale of Spain and 'spa-ES' designates Spanish language used in Spain. 'spa-ES_CL' designates spanish language of Spain, for the Chilean locale.
Fewer files are needed when an application supports these scenarios:
Lang data is same for each locale, but is different by language
A group of categories, such as 'food' and 'health'. One data is defined for all locales -with translations.
categories/baseLang.json categories/eng-US.json categories/spa-ES.json categories/spa-CL.json
Locale data differs for each locale, but is one language for each
A legal document, such as a 'user agreement'. Specific data for each locale is defined -no translations.
terms-and-conditions/baseLocale.json terms-and-conditions/US.json terms-and-conditions/ES.json terms-and-conditions/CL.json
LangLocale data differs for each locale and language
A list of banks, sub-regions (prefectures or states) or payment gateways. Specific data for each locale is defined -with translations.
municipalities/baseLangLocaleArr.json municipalities/eng-US_USArr.json municipalities/eng-US_ESArr.json municipalities/eng-US_CLArr.json municipalities/spa-ES_USArr.json municipalities/spa-ES_ESArr.json municipalities/spa-ES_CLArr.json municipalities/spa-CL_USArr.json municipalities/spa-CL_ESArr.json municipalities/spa-CL_CLArr.json
A data might differ only by 'lang' or 'locale'. If your application supports 3 locales and 3 languages does this data need to exist in 9 files or 3?
Overview, Page Objects
Reference smaller files from another file -page-deploy will build that new file for you.
properties file and special values...
Overview, Support Files
Use local paths to support files such as images. page-deploy will update the paths to web accessible ones.