bem-site / bem-lib-site-view

1 stars 3 forks source link

Platforms files overwrite each other #2

Closed iniel closed 8 years ago

iniel commented 8 years ago

I think there is a problem with copying all files to the one folder like this:

cpy([path.join(pathToData, '{' + platforms.join() + '}' + '.examples', '**', '*.{html,css,js}')], outputFolder)
output/
    ├── data/
    │ └──...
    └── bem-components/
        ├── ru/
        │ ├── desktop/
        │ │ ├── button/
        │ │ │ └── index.html
        │ │ └── ...
        │ ├── touch-pad/
        │ │ ├── button/
        │ │ │ └── index.html
        │ │ └── ...
        │ └── touch-phone/
        │     ├── button/
        │     │ └── index.html
        │     └── ...
        │
        ├── AwGbvB7vF9bbamIP8ICDgP5bA-w.bemdecl.js
        └── ...

Example files for different platforms have the same name, so desktop files will be overwritten by touch-pad files and touch-pad will be overwritten by touch-phone.

What do you think about this organization?

output/
    ├── data/
    │ └──...
    └── bem-components/
        ├── ru/
        │ ├── desktop/
        │ │ ├── button/
        │ │ │ ├── index.html
        │ │ │ ├── AwGbvB7vF9bbamIP8ICDgP5bA-w.bemdecl.js
        │ │ │ └── ...
        │ │ └── ...
        │ ├── touch-pad/
        │ │ ├── button/
        │ │ │ ├── index.html
        │ │ │ ├── AwGbvB7vF9bbamIP8ICDgP5bA-w.bemdecl.js
        │ │ │ └── ...
        │ │ └── ...
        │ └── touch-phone/
        │     ├── button/
        │     │ ├── index.html
        │     │ ├── AwGbvB7vF9bbamIP8ICDgP5bA-w.bemdecl.js
        │     │ └── ...
        │     └── ...
        └──...
vithar commented 8 years ago

Examples with the same hash name are the same.

iniel commented 8 years ago

The same hash name means the same bemjson, but bemhtml, css, js can be different on different platforms, so https://github.com/bem-site/bem-lib-site-data build them in separate folders (desktop.examples, touch-pad.examples, touch-phone.examples).

tadatuta commented 8 years ago

@iniel, sounds reasonable, we will fix it. thank you!

vithar commented 8 years ago

Fixed in https://github.com/bem-site/bem-lib-site-view/pull/20