Skip to content

Commit 8752010

Browse files
committed
feat(tooling): pnpm workspace
1 parent 82ed129 commit 8752010

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+796
-481
lines changed

.github/workflows/build.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,6 @@ jobs:
2727
- name: Install dependencies
2828
run: pnpm install --frozen-lockfile --ignore-scripts
2929
- name: Run build
30-
run: pnpm build
30+
run: pnpm --filter=react-dadata build:ci
3131

3232

.github/workflows/linter.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,5 +24,5 @@ jobs:
2424
- name: Install dependencies
2525
run: pnpm install --frozen-lockfile --ignore-scripts
2626
- name: Run tests
27-
run: pnpm test:lint
27+
run: pnpm --filter=react-dadata test:lint
2828

.github/workflows/size-limit.yml

+1
Original file line numberDiff line numberDiff line change
@@ -26,5 +26,6 @@ jobs:
2626
uses: andresz1/size-limit-action@v1
2727
with:
2828
build_script: build
29+
directory: packages/react-dadata
2930
package_manager: pnpm
3031
github_token: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/test.yml

+2-1
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,9 @@ jobs:
2828
- name: Install dependencies
2929
run: pnpm install --frozen-lockfile --ignore-scripts
3030
- name: Run tests
31-
run: pnpm test
31+
run: pnpm --filter=react-dadata test
3232
- name: Coveralls
3333
uses: coverallsapp/github-action@master
3434
with:
3535
github-token: ${{ secrets.GITHUB_TOKEN }}
36+
base-path: packages/react-dadata

package.json

+3-93
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,7 @@
11
{
2-
"name": "react-dadata",
3-
"version": "2.23.1",
2+
"name": "@vitalybaev/react-dadata",
3+
"private": true,
44
"description": "React-компонент для подсказок адресов, организаций и банков с помощью сервиса DaData.ru",
5-
"main": "dist/cjs/index.js",
6-
"module": "dist/esm/index.js",
7-
"types": "dist/index.d.ts",
8-
"scripts": {
9-
"prepublishOnly": "npm run test && npm run build",
10-
"clean": "rimraf dist",
11-
"build:css": "./node_modules/lightningcss-cli-linux-x64-gnu/lightningcss --minify --bundle --targets '>0.2%, ie 11' src/react-dadata.css -o dist/react-dadata.css",
12-
"build:cjs": "tsc --module commonjs --target es5 --outDir dist/cjs",
13-
"build:esm": "tsc --module es2015 --target es5 --outDir dist/esm",
14-
"build:types": "tsc --declaration --emitDeclarationOnly --outDir dist",
15-
"build": "NODE_ENV=production run-s clean build:css build:cjs build:esm build:types",
16-
"size-build": "npm run build:esm",
17-
"test:lint": "biome check src/ example/",
18-
"test:size-limit": "npm run build:esm && size-limit",
19-
"test": "vitest --coverage",
20-
"vitest-preview": "vitest-preview"
21-
},
22-
"repository": {
23-
"type": "git",
24-
"url": "git+https://github.com/vitalybaev/react-dadata.git"
25-
},
265
"keywords": [
276
"react",
287
"reactjs",
@@ -39,80 +18,11 @@
3918
"url": "https://github.com/vitalybaev/react-dadata/issues"
4019
},
4120
"homepage": "https://vitalybaev.github.io/react-dadata/",
42-
"dependencies": {
43-
"debounce": "^1.2.1",
44-
"highlight-words": "^1.2.1",
45-
"nanoid": "^3.3.6",
46-
"shallowequal": "^1.1.0"
47-
},
4821
"devDependencies": {
4922
"@biomejs/biome": "1.8.3",
50-
"@size-limit/preset-small-lib": "^8.0.0",
51-
"@testing-library/jest-dom": "^6.4.8",
52-
"@testing-library/react": "^16.0.0",
53-
"@testing-library/user-event": "^14.5.2",
54-
"@types/debounce": "^1.2.1",
55-
"@types/node": "^18.16.3",
56-
"@types/react": "^18.3.3",
57-
"@types/shallowequal": "^1.1.1",
58-
"@vitest/coverage-v8": "^2.0.5",
59-
"core-js": "^3.30.1",
60-
"jsdom": "^24.1.1",
61-
"lightningcss-cli": "^1.26.0",
62-
"lightningcss-cli-linux-x64-gnu": "^1.26.0",
63-
"msw": "^2.3.5",
6423
"npm-run-all2": "^5.0.0",
65-
"react": "^18.3.1",
66-
"react-dom": "^18.3.1",
6724
"regenerator-runtime": "^0.13.11",
68-
"rimraf": "^5.0.0",
69-
"size-limit": "^8.0.0",
70-
"typescript": "^5.5.4",
71-
"vitest": "^2.0.5",
72-
"vitest-preview": "^0.0.1"
73-
},
74-
"peerDependencies": {
75-
"react": "^15.6 || ^16.0 || ^17.0 || ^18.0",
76-
"react-dom": "^15.6 || ^16.0 || ^17.0 || ^18.0"
77-
},
78-
"size-limit": [
79-
{
80-
"name": "AddressSuggestions",
81-
"path": "dist/esm/index.js",
82-
"import": "{ AddressSuggestions }",
83-
"limit": "6 KB"
84-
},
85-
{
86-
"name": "PartySuggestions",
87-
"path": "dist/esm/index.js",
88-
"import": "{ PartySuggestions }",
89-
"limit": "6 KB"
90-
},
91-
{
92-
"name": "FioSuggestions",
93-
"path": "dist/esm/index.js",
94-
"import": "{ FioSuggestions }",
95-
"limit": "6 KB"
96-
},
97-
{
98-
"name": "BankSuggestions",
99-
"path": "dist/esm/index.js",
100-
"import": "{ BankSuggestions }",
101-
"limit": "6 KB"
102-
}
103-
],
104-
"browserslist": {
105-
"production": [
106-
">0.2%",
107-
"ie 11",
108-
"not dead",
109-
"not op_mini all"
110-
],
111-
"development": [
112-
"last 1 chrome version",
113-
"last 1 firefox version",
114-
"last 1 safari version"
115-
]
25+
"rimraf": "^5.0.0"
11626
},
11727
"packageManager": "[email protected]"
11828
}
File renamed without changes.
File renamed without changes.

example/package.json packages/example/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
"dependencies": {
1010
"react": "^18.0.0",
1111
"react-dom": "^18.0.0",
12-
"react-dadata": ".."
12+
"react-dadata": "workspace:*"
1313
},
1414
"devDependencies": {
1515
"@types/react": "^18.0.0",
File renamed without changes.

example/src/App.tsx packages/example/src/App.tsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
import React from 'react';
22
import './App.css';
33
import 'react-dadata/src/react-dadata.css';
4-
import { AddressSuggestions } from '../../src/AddressSuggestions';
4+
import { AddressSuggestions } from '../../react-dadata/src/AddressSuggestions';
55

6-
const DADATA_TOKEN = '';
6+
const DADATA_TOKEN = '3c2e964517d7358776e07d7d699cc2b0626dac54';
77

88
function App() {
99
if (!DADATA_TOKEN) {
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

packages/react-dadata/package.json

+99
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,99 @@
1+
{
2+
"name": "react-dadata",
3+
"version": "2.23.1",
4+
"description": "React-компонент для подсказок адресов, организаций и банков с помощью сервиса DaData.ru",
5+
"main": "dist/cjs/index.js",
6+
"module": "dist/esm/index.js",
7+
"types": "dist/index.d.ts",
8+
"scripts": {
9+
"prepublishOnly": "pnpm run test && pnpm run build",
10+
"clean": "rimraf dist",
11+
"build:css": "lightningcss --minify --bundle --targets '>0.2%, ie 11' src/react-dadata.css -o dist/react-dadata.css",
12+
"build:css:ci": "./node_modules/lightningcss-cli-linux-x64-gnu/lightningcss --minify --bundle --targets '>0.2%, ie 11' src/react-dadata.css -o dist/react-dadata.css",
13+
"build:cjs": "tsc --module commonjs --target es5 --outDir dist/cjs",
14+
"build:esm": "tsc --module es2015 --target es5 --outDir dist/esm",
15+
"build:types": "tsc --declaration --emitDeclarationOnly --outDir dist",
16+
"build:ci": "NODE_ENV=production run-s clean build:css:ci build:cjs build:esm build:types",
17+
"build": "NODE_ENV=production run-s clean build:css build:cjs build:esm build:types",
18+
"size-build": "pnpm build:esm",
19+
"test:lint": "biome check src/ example/",
20+
"test:size-limit": "pnpm build:esm && size-limit",
21+
"test": "vitest --coverage",
22+
"vitest-preview": "vitest-preview"
23+
},
24+
"repository": {
25+
"type": "git",
26+
"url": "git+https://github.com/vitalybaev/react-dadata.git"
27+
},
28+
"dependencies": {
29+
"debounce": "^1.2.1",
30+
"highlight-words": "^1.2.1",
31+
"nanoid": "^3.3.6",
32+
"shallowequal": "^1.1.0"
33+
},
34+
"devDependencies": {
35+
"@size-limit/preset-small-lib": "^8.0.0",
36+
"@testing-library/jest-dom": "^6.4.8",
37+
"@testing-library/react": "^16.0.0",
38+
"@testing-library/user-event": "^14.5.2",
39+
"@vitest/coverage-v8": "^2.0.5",
40+
"core-js": "^3.30.1",
41+
"jsdom": "^24.1.1",
42+
"lightningcss-cli": "^1.26.0",
43+
"lightningcss-cli-linux-x64-gnu": "^1.26.0",
44+
"msw": "^2.3.5",
45+
"@types/debounce": "^1.2.1",
46+
"@types/node": "^18.16.3",
47+
"@types/react": "^18.3.3",
48+
"@types/shallowequal": "^1.1.1",
49+
"react": "^18.3.1",
50+
"react-dom": "^18.3.1",
51+
"size-limit": "^8.0.0",
52+
"typescript": "^5.5.4",
53+
"vitest": "^2.0.5",
54+
"vitest-preview": "^0.0.1"
55+
},
56+
"peerDependencies": {
57+
"react": "^15.6 || ^16.0 || ^17.0 || ^18.0",
58+
"react-dom": "^15.6 || ^16.0 || ^17.0 || ^18.0"
59+
},
60+
"size-limit": [
61+
{
62+
"name": "AddressSuggestions",
63+
"path": "dist/esm/index.js",
64+
"import": "{ AddressSuggestions }",
65+
"limit": "6 KB"
66+
},
67+
{
68+
"name": "PartySuggestions",
69+
"path": "dist/esm/index.js",
70+
"import": "{ PartySuggestions }",
71+
"limit": "6 KB"
72+
},
73+
{
74+
"name": "FioSuggestions",
75+
"path": "dist/esm/index.js",
76+
"import": "{ FioSuggestions }",
77+
"limit": "6 KB"
78+
},
79+
{
80+
"name": "BankSuggestions",
81+
"path": "dist/esm/index.js",
82+
"import": "{ BankSuggestions }",
83+
"limit": "6 KB"
84+
}
85+
],
86+
"browserslist": {
87+
"production": [
88+
">0.2%",
89+
"ie 11",
90+
"not dead",
91+
"not op_mini all"
92+
],
93+
"development": [
94+
"last 1 chrome version",
95+
"last 1 firefox version",
96+
"last 1 safari version"
97+
]
98+
}
99+
}
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

src/types.ts packages/react-dadata/src/types.ts

+1
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ export interface CommonProps<SuggestionType> {
2424
inputProps?: HTMLProps<HTMLInputElement>;
2525
hintText?: ReactNode;
2626
renderOption?: (suggestion: DaDataSuggestion<SuggestionType>, inputValue: string) => ReactNode;
27+
renderNoSuggestions?: () => ReactNode;
2728
containerClassName?: string;
2829
suggestionsClassName?: string;
2930
suggestionClassName?: string;
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)