Skip to content

Commit ef88fc3

Browse files
committed
refactor: migrate build to zshy
1 parent 69d3c10 commit ef88fc3

File tree

12 files changed

+120
-50
lines changed

12 files changed

+120
-50
lines changed

.changeset/polite-moles-lie.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"mobx-view-model": minor
3+
---
4+
5+
migrate to zshy tool (bundler free tsc tool) to better DX and tree shaking

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,11 @@
1616
[bundlephobia-image]: https://badgen.net/bundlephobia/minzip/mobx-view-model
1717

1818

19-
_MobX ViewModel power for ReactJS_
19+
⚡ Clean MVVM for React + MobX | Powerful ViewModels made simple ⚡
2020

2121
Library for integration [MVVM](https://en.wikipedia.org/wiki/Model%E2%80%93view%E2%80%93viewmodel) pattern with [MobX](https://mobx.js.org/README.html) and [React](https://react.dev/).
2222

23-
## Documentation is [here](https://js2me.github.io/mobx-view-model/)
23+
## [Read the docs →](https://js2me.github.io/mobx-web-api/)
2424

2525

2626
_React's HOC approach_

docs/.vitepress/theme/style.css

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -169,4 +169,68 @@ p:has(>em:first-child:last-child) + div[class*=language-] {
169169

170170
.vp-doc strong code {
171171
font-weight: bold;
172+
}
173+
174+
.VPHome {
175+
flex: 1;
176+
display: flex;
177+
flex-direction: column;
178+
margin-bottom: 0 !important;
179+
}
180+
181+
.VPContent.is-home {
182+
display: flex;
183+
}
184+
185+
.VPHero.has-image.VPHomeHero {
186+
flex: 1;
187+
display: flex;
188+
flex-direction: column;
189+
}
190+
191+
.VPHero.has-image .main {position: relative;}
192+
193+
.VPHero.has-image .container {
194+
padding-left: 2rem;
195+
padding-right: 2rem;
196+
margin-top: auto;
197+
margin-bottom: auto;
198+
padding-bottom: 7vh;
199+
}
200+
201+
.main > .heading > .text {
202+
font-size: 24px;
203+
line-height: 28px;
204+
padding-top: 20px;
205+
}
206+
207+
html .VPFooter {
208+
border-top: 0 !important;
209+
}
210+
211+
html:has(.VPFeatures.VPHomeFeatures .items > .item) .VPHero.has-image .container {
212+
margin-bottom: 0;
213+
margin-top: auto;
214+
}
215+
html:has(.VPFeatures.VPHomeFeatures .items > .item) .VPHero.has-image.VPHomeHero {
216+
flex: 1;
217+
}
218+
html:has(.VPFeatures.VPHomeFeatures .items > .item) .VPFeatures.VPHomeFeatures {
219+
margin-bottom: auto;
220+
flex: 1;
221+
}
222+
223+
html.gh-preview .main > .heading > .name {
224+
line-height: 72px;
225+
font-size: 68px;
226+
}
227+
html.gh-preview .main > .heading > .text {
228+
font-size: 43px;
229+
line-height: 48px;
230+
}
231+
html.gh-preview .main > .actions {
232+
opacity: 0;
233+
}
234+
html.gh-preview .VPFeatures.VPHomeFeatures {
235+
opacity: 0;
172236
}

docs/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ layout: home
44

55
hero:
66
name: '{packageJson.name}'
7-
text: '{packageJson.description}'
7+
text: '⚡ Clean MVVM for React + MobX ⚡'
88
image:
99
src: /logo.png
1010
actions:

docs/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
"vue": "^3.5.13",
99
"unocss": "^0.61.9",
1010
"vite": "^5.3.1",
11-
"vitepress": "^1.3.2"
11+
"vitepress": "^1.6.4"
1212
},
1313
"scripts": {
1414
"dev": "vitepress dev",

docs/pnpm-lock.yaml

Lines changed: 5 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 20 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@
99
"check": "npm run lint:check && npm run ts:check",
1010
"prebuild": "npm run clean && npm run check",
1111
"build:watch": "pnpm build && nodemon --watch src --ext ts,tsx --exec \"pnpm build\"",
12-
"build": "tsc && tsx scripts/post-build",
13-
"pub": "pnpm build && node node_modules/js2me-exports-post-build-script/scripts/publish --openDistDir",
12+
"build": "zshy",
13+
"pub": "pnpm build && sborshik publish",
1414
"pub:patch": "PUBLISH_VERSION=patch pnpm pub",
1515
"pub:minor": "PUBLISH_VERSION=minor pnpm pub",
1616
"pub:major": "PUBLISH_VERSION=major pnpm pub",
@@ -45,7 +45,7 @@
4545
},
4646
"author": "js2me",
4747
"license": "MIT",
48-
"description": "MobX ViewModel power for ReactJS",
48+
"description": "⚡ Clean MVVM for React + MobX | Powerful ViewModels made simple ⚡",
4949
"bugs": {
5050
"url": "https://github.com/js2me/mobx-view-model/issues"
5151
},
@@ -57,7 +57,7 @@
5757
},
5858
"dependencies": {
5959
"react-simple-loadable": "^2.3.9",
60-
"yummies": "^5.4.7"
60+
"yummies": "^5.4.8"
6161
},
6262
"peerDependencies": {
6363
"mobx": "^6.12.4",
@@ -76,7 +76,7 @@
7676
"@vitest/coverage-istanbul": "^3.1.2",
7777
"commitfmt": "^1.0.4",
7878
"js2me-biome-config": "^1.0.4",
79-
"js2me-exports-post-build-script": "^5.7.1",
79+
"sborshik": "^1.0.6",
8080
"jsdom": "^26.1.0",
8181
"lefthook": "^1.11.16",
8282
"nodemon": "^3.1.9",
@@ -86,5 +86,19 @@
8686
"vitest": "^3.1.2",
8787
"zshy": "^0.4.2"
8888
},
89-
"packageManager": "[email protected]+sha512.140036830124618d624a2187b50d04289d5a087f326c9edfc0ccd733d76c4f52c3a313d4fc148794a2a9d81553016004e6742e8cf850670268a7387fc220c903"
89+
"packageManager": "[email protected]+sha512.140036830124618d624a2187b50d04289d5a087f326c9edfc0ccd733d76c4f52c3a313d4fc148794a2a9d81553016004e6742e8cf850670268a7387fc220c903",
90+
"files": [
91+
"dist"
92+
],
93+
"main": "./dist/index.cjs",
94+
"module": "./dist/index.js",
95+
"types": "./dist/index.d.cts",
96+
"exports": {
97+
"./package.json": "./package.json",
98+
".": {
99+
"types": "./dist/index.d.cts",
100+
"import": "./dist/index.js",
101+
"require": "./dist/index.cjs"
102+
}
103+
}
90104
}

pnpm-lock.yaml

Lines changed: 20 additions & 19 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

scripts/post-build.ts

Lines changed: 0 additions & 10 deletions
This file was deleted.

src/utils/generate-vm-id.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
11
import { createCounter } from 'yummies/complex';
2-
2+
import type { AnyObject } from 'yummies/utils/types';
33
import type { GenerateViewModelIdFn } from '../config/index.js';
44

5-
import type { AnyObject } from './types.js';
6-
75
declare const process: { env: { NODE_ENV?: string } };
86

97
const staticCounter = createCounter((counter) => counter.toString(16));

0 commit comments

Comments
 (0)