Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Per level naming #34

Merged
merged 2 commits into from
May 6, 2017
Merged

Per level naming #34

merged 2 commits into from
May 6, 2017

Conversation

awinogradov
Copy link
Member

Close #25

README.md Outdated
@@ -52,7 +52,7 @@ On file system:

```
blocks/Attach/
├── Attach.react.js
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this was added to show how techMap works:
check it earlier in readMe

     techMap: {
         js : ['react.js']
     }

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, I'll revert this changes

index.js Outdated
@@ -4,8 +4,9 @@ const path = require('path'),
bn = require('@bem/naming'),
BemCell = require('@bem/cell'),
BemEntityName = require('@bem/entity-name'),
bemFs = require('@bem/fs-scheme')(),
bemFs = require('@bem/fs-scheme')(), // TODO: plain
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe it's better to add issue instead of TODO ?

),
levels = options.levels,
options = Object.assign({}, this.options.bemLoader, loaderUtils.getOptions(this)),
levelsMap = bemConfig.levelMapSync() || opts.levels,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So then change readme to show that levels could be hash

@@ -68,7 +67,8 @@ module.exports = function(source) {
}, [])
// find path for every entity and check it existance
.map(bemCell => {
const entityPath = path.resolve(bemFs.path(bemCell, namingOptions));
const localNamingOpts = levelsMap[bemCell.layer].naming || namingOptions;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't sure but I think that bemCell.layer is absolute path. did you check it?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, it's ok

"@bem/import-notation": "^1.1.2",
"@bem/naming": "^2.0.0-6",
"bem-config": "^3.2.3",
"falafel": "^2.1.0",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it's major, nothing changed in API ?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It works)

@@ -53,6 +51,7 @@ module.exports = function(source) {

const existingEntitiesPromises = bemImport.parse(
node.arguments[0].value,
// FIXME: we really need this context for parsing import?
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't remember =( that's why issues are better

Copy link
Member Author

@awinogradov awinogradov May 6, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's my comment) I asked about the next line)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's could be a problem if we use bemNaming here
I suppose we need to use bem-fs-scheme here because we are parsing name of file

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@awinogradov awinogradov merged commit a1432e8 into master May 6, 2017
awinogradov added a commit that referenced this pull request May 6, 2017
@awinogradov awinogradov deleted the naming branch May 6, 2017 18:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants