Skip to content

Commit e33b98a

Browse files
committed
publish config
1 parent 1bf2cc5 commit e33b98a

11 files changed

Lines changed: 45 additions & 17 deletions

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
dist/

Makefile

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
node_modules: package-lock.json package.json
2+
npm ci
3+
4+
dist: node_modules
5+
npm run test
6+
npm run build
7+
8+
.PHONY: publish
9+
publish: dist
10+
@jq --arg version $(VERSION) '. + { $$version }' < package.json > dist/package.json
11+
npm publish --access public dist/
12+
13+
.PHONY: clean
14+
clean:
15+
rm -fr dist/
16+
17+
.DEFAULT_GOAL := publish

Readme.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
## Installation
88

9-
`npm install react-bem-template-functions`
9+
`npm install @puck/react-bem`
1010

1111
## Usage
1212

@@ -202,7 +202,7 @@ display name and your CSS block name. The CSS name will be converted to `snake-c
202202
4. Wrap your export in a `withBem()` HOC
203203

204204
```tsx
205-
import { withBem } from 'react-bem-template-functions'
205+
import { withBem } from '@puck/react-bem'
206206

207207
type Props = {
208208
title: string;

jest.config.js

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,15 @@
11
module.exports = {
2-
preset: 'ts-jest',
3-
testEnvironment: 'jsdom',
4-
testMatch: ['**/*.spec.ts', '**/*.spec.tsx'],
5-
transform: {
6-
'.+': ['ts-jest', {
7-
diagnostics: {
8-
ignoreCodes: ['TS151001'],
9-
},
10-
}],
11-
}
2+
preset: "ts-jest",
3+
testEnvironment: "jsdom",
4+
testMatch: ["**/*.spec.ts", "**/*.spec.tsx"],
5+
transform: {
6+
".+": [
7+
"ts-jest",
8+
{
9+
diagnostics: {
10+
ignoreCodes: ["TS151001"],
11+
},
12+
},
13+
],
14+
},
1215
};

package.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
{
2-
"name": "react-bem-template-functions",
2+
"name": "@puck/react-bem",
3+
"main": "index.js",
4+
"license": "MIT",
35
"devDependencies": {
46
"@testing-library/dom": "^10.4.0",
57
"@testing-library/react": "^16.0.0",
File renamed without changes.
File renamed without changes.
File renamed without changes.

index.tsx renamed to src/index.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ type OptionalClassName = {
9292
};
9393

9494
function createWrappedComponent<P>(
95-
name,
95+
name: string,
9696
Component: React.ComponentType<BemProps<P>>,
9797
): React.ComponentType<P & OptionalClassName> {
9898
const WrappedComponent = (args: P) => {
@@ -104,7 +104,7 @@ function createWrappedComponent<P>(
104104
return WrappedComponent;
105105
}
106106

107-
export function withBem(Component) {
107+
export function withBem<P>(Component: React.ComponentType<BemProps<P>>) {
108108
const name = Component.displayName;
109109
if (!name) {
110110
console.warn(

0 commit comments

Comments
 (0)