<commit_before>Static Bundler
--------------

- prepare dynamic generated files (api-tree, languages)
- grab all views and assets from all enabled applications
- execute skinner to build themes
- localize and compile views (for each theme)
- run assets builder (patch/merge/minify)


### Stage 1. Prepare dynamic data for assets

Once API tree of the application was fully populated, and i18n being loaded,
we generate API tree (with stubbed server methods) and i18n bundles:

```
assets
 └─ system/
     ├─ <namespace>/
     │   ├─ api-tree.js    # nodeca.<namespace>.* (server, shared, client)
     │   └─ i18n/
     │       └─ <lang>.js  # nodeca.<namespace>.i18n.<lang>
     └─ ...
```

`nodeca.<namespace>.server.*` contains methods with signatures similar to
original ones, but bodies ready to be used on the client and call corresponding
server methods transparently.


### Stage 2. Prepare views

##### 2.1. Combine theme views<commit_msg>Update static bundler workflow<commit_after>Static Bundler
--------------

- prepare dynamic generated files (api-tree, languages).
- make copy of all views and assets from all enabled applications
  into tmp directories by app. make unque filenames for patch files.
- move base themes (not inherited or extended) into one place.

- merge extended themes into base themes.
- prepare directories of inherited themes.
  watch for inheritance tree.
- merge non-theme assets.

- apply patches for assets and views.
- merge subdirs into files (`./assets/_foobar.js/*` -> `./assets/foobar.js`)

- localize views (for each theme).

- compile (jade -> json, stylus -> css).
- uglify assets.


### Stage 1. Prepare dynamic data for assets

Once API tree of the application was fully populated, and i18n being loaded,
we generate API tree (with stubbed server methods) and i18n bundles:

```
assets
 └─ system/
     ├─ <namespace>/
     │   ├─ api-tree.js    # nodeca.<namespace>.* (server, shared, client)
     │   └─ i18n/
     │       └─ <lang>.js  # nodeca.<namespace>.i18n.<lang>
     └─ ...
```

`nodeca.<namespace>.server.*` contains methods with signatures similar to
original ones, but bodies ready to be used on the client and call corresponding
server methods transparently.


### Stage 2. Prepare views

##### 2.1. Combine theme views
{'fraction_non_alphanumeric': 0.11826544021024968, 'fraction_numerical': 0.010512483574244415, 'mean_word_length': 3.2062615101289134, 'pattern_counts': {'":': 0, '<': 15, '<?xml version=': 0, '>': 18, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '961619', 'n_tokens_mistral': 675, 'n_tokens_neox': 650, 'n_words': 283}