-
Notifications
You must be signed in to change notification settings - Fork 63
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
b1ddca0
commit b192fc5
Showing
54 changed files
with
576 additions
and
2,082 deletions.
There are no files selected for viewing
File renamed without changes.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,15 @@ | ||
module.exports = { | ||
rootDir: `./packages/${process.env.PKG}`, | ||
testPathIgnorePatterns : ['node_modules'], | ||
moduleFileExtensions : ['ts', 'tsx', 'js'], | ||
setupFiles: [ | ||
'./jestSetup.js' | ||
`./test/setup/index.js` | ||
], | ||
transform : { | ||
'^.+\\.(ts|tsx)$' : 'ts-jest' | ||
}, | ||
testMatch : [ | ||
'**/test/*.+(ts|tsx)', | ||
'**/test/*.+(ts|tsx)' | ||
] | ||
`**/test/*.+(ts|tsx)`, | ||
`**/test/*.+(ts|tsx)` | ||
], | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,7 @@ | ||
{ | ||
"lerna": "2.5.1", | ||
"lerna": "3.1.4", | ||
"packages": [ | ||
".", | ||
"packages/*" | ||
], | ||
"command": { | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,43 +1,49 @@ | ||
{ | ||
"name": "bem-react-core", | ||
"version": "2.0.0", | ||
"description": "BEM React Core", | ||
"name": "bem-react", | ||
"private": true, | ||
"version": "3.0.0", | ||
"description": "BEM React", | ||
"repository": { | ||
"url": "git://github.com/bem/bem-react-core.git", | ||
"type": "git" | ||
}, | ||
"keywords": [ | ||
"bem", | ||
"react", | ||
"preact", | ||
"core" | ||
], | ||
"license": "MPL-2.0", | ||
"scripts": { | ||
"lint": "tsc -p . --noEmit && tslint -p . -t stylish", | ||
"lint": "lerna run lint", | ||
"test": "lerna run test", | ||
"prepush": "lerna run test", | ||
"commitmsg": "commitlint -e $GIT_PARAMS" | ||
}, | ||
"devDependencies": { | ||
"@babel/core": "7.0.0", | ||
"@babel/helper-module-imports": "7.0.0", | ||
"@babel/preset-env": "7.0.0", | ||
"@commitlint/cli": "6.1.3", | ||
"@commitlint/config-conventional": "6.1.3", | ||
"babel-plugin-external-helpers": "6.22.0", | ||
"babel-plugin-transform-object-assign": "6.22.0", | ||
"babel-preset-env": "^1.6.1", | ||
"gzip-size-cli": "2.1.0", | ||
"@types/jest": "23.3.1", | ||
"@types/react": "16.4.12", | ||
"@types/react-dom": "16.0.7", | ||
"chalk": "2.4.1", | ||
"gzip-size-cli": "3.0.0", | ||
"husky": "0.14.3", | ||
"lerna": "^2.5.1", | ||
"npm-run-all": "4.1.2", | ||
"react-test-renderer": "16.3.0", | ||
"rollup": "0.57.1", | ||
"rollup-plugin-babel": "^3.0.3", | ||
"rollup-plugin-commonjs": "9.1.0", | ||
"jest": "23.5.0", | ||
"lerna": "3.2.0", | ||
"rollup": "0.65.0", | ||
"rollup-plugin-babel": "4.0.2", | ||
"rollup-plugin-commonjs": "9.1.6", | ||
"rollup-plugin-node-resolve": "3.3.0", | ||
"rollup-plugin-replace": "2.0.0", | ||
"tslint": "5.9.1", | ||
"tslint-react": "3.5.1", | ||
"typescript": "2.8.1", | ||
"uglify-js": "3.3.18" | ||
"rollup-plugin-typescript2": "0.17.0", | ||
"rollup-plugin-uglify": "4.0.0", | ||
"ts-jest": "23.1.4", | ||
"tslint": "5.11.0", | ||
"tslint-react": "3.6.0", | ||
"typescript": "3.0.1", | ||
"uglify-js": "3.4.8" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
import { stringifyWrapper } from '@bem/sdk.naming.entity.stringify'; | ||
|
||
const react = require('@bem/sdk.naming.presets/react'); | ||
|
||
export type NoStrictEntityMods = Record<string, string | boolean | number | undefined>; | ||
|
||
export type EntityFormatter = (mods?: NoStrictEntityMods) => string; | ||
|
||
function modsToArray(block: string, elem?: string, mods?: NoStrictEntityMods) { | ||
const arr = []; | ||
|
||
if (!mods) return []; | ||
|
||
for (const modName in mods) { | ||
if (mods[modName] || mods[modName] === 0) { | ||
arr.push({ | ||
block, | ||
elem, | ||
mod: { | ||
name: modName, | ||
val: mods[modName] === true ? true : String(mods[modName]), | ||
}, | ||
}); | ||
} | ||
} | ||
|
||
return arr; | ||
} | ||
|
||
export function entity(block: string, elem?: string): EntityFormatter { | ||
const naming = stringifyWrapper(react); | ||
|
||
return (mods?: NoStrictEntityMods) => modsToArray(block, elem, mods).map(naming).join(' '); | ||
} |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
'use strict'; | ||
|
||
if (process.env.NODE_ENV === 'production') { | ||
module.exports = require('./build/cjs/di.production.min.js'); | ||
} else { | ||
module.exports = require('./build/cjs/di.development.js'); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
{ | ||
"name": "@bem-react/classname", | ||
"version": "0.0.1", | ||
"description": "BEM React ClassName", | ||
"repository": { | ||
"url": "git://github.com/bem/bem-react-core.git", | ||
"type": "git" | ||
}, | ||
"keywords": [ | ||
"bem", | ||
"core" | ||
], | ||
"main": "index.js", | ||
"typings": ".rpt2_cache/placeholder/classname.d.ts", | ||
"files": [ | ||
".rpt2_cache", | ||
"build" | ||
], | ||
"license": "MPL-2.0", | ||
"scripts": { | ||
"prepublishOnly": "npm run build", | ||
"build": "PKG=classname node ../../scripts/rollup/build.js", | ||
"lint": "__DEV__=1 tsc -p . --noEmit && tslint -p . -t stylish", | ||
"test": "echo 'PKG=classname NODE_ENV=test jest --config=../../jest.config.js'" | ||
}, | ||
"dependencies": { | ||
"@bem/sdk.naming.entity.stringify": "1.1.1", | ||
"@bem/sdk.naming.presets": "0.2.2" | ||
}, | ||
"peerDependencies": { | ||
"react": "^15.6.2 || ^16.0.0" | ||
}, | ||
"devDependencies": { | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
it('placeholder', () => { | ||
expect(true).toBe(true); | ||
}); |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"extends": "../../tsconfig.json" | ||
} |
File renamed without changes.
Oops, something went wrong.