Skip to content

Commit

Permalink
Merge pull request #164 from heluxjs/doc
Browse files Browse the repository at this point in the history
Doc
  • Loading branch information
fantasticsoul authored Jun 6, 2024
2 parents d299811 + b5aa7d4 commit 8f665a7
Show file tree
Hide file tree
Showing 24 changed files with 326 additions and 27 deletions.
2 changes: 2 additions & 0 deletions PUB.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@

### changeset 发布

跟目录处先执行构建 `pnpm run build`

使用 changeset 分以下几步:

1. 当代码变更后,执行 `pnpm changeset` ,会让你输入选择变更的包和输入变更日志.
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
- [Doc](https://heluxjs.github.io/helux)
- [Playground](https://heluxjs.github.io/helux/playground)
- [Helux-react-starter](https://codesandbox.io/p/sandbox/helux-react-starter-ts-539scq)
- [Helux-openinula-starter](https://codesandbox.io/p/devbox/helux-openinula-66gfj2)
- [Helux-preact-starter](https://codesandbox.io/p/sandbox/helux-preact-starter-dnyzpy)
- [Helux-nextjs-starter](https://github.com/heluxjs/helux-nextjs-starter)

Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "helux",
"version": "4.3.1",
"version": "4.3.5",
"description": "A reactive atomic state engine for React like.",
"keywords": [],
"author": {
Expand All @@ -12,7 +12,7 @@
"scripts": {
"build": "turbo run build",
"build:watch": "turbo run build:watch",
"build_devtool": "pnpm --filter=helux-devtool run build",
"build_devtool": "pnpm --filter=@helux/plugin-devtool run build",
"build_helux": "pnpm --filter=helux run build",
"changeset": "changeset",
"commitlint": "commitlint -e $HUSKY_GIT_PARAMS",
Expand Down
29 changes: 29 additions & 0 deletions packages/helux-core/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,34 @@
# @helux/core

## 4.3.5

### Patch Changes

- a17d460: mark ver as 4.3.5
- Updated dependencies [a17d460]
- @helux/hooks-impl@4.3.5
- @helux/types@4.3.5
- @helux/utils@4.3.5

## 4.3.4

### Patch Changes

- ef43031: ignore Loading dup tip
- Updated dependencies [ef43031]
- @helux/hooks-impl@4.3.4
- @helux/types@4.3.4
- @helux/utils@4.3.4

## 4.3.3

### Patch Changes

- 8451c13: ignore Loading dup tip
- @helux/hooks-impl@4.3.3
- @helux/types@4.3.3
- @helux/utils@4.3.3

## 4.3.2

### Patch Changes
Expand Down
2 changes: 1 addition & 1 deletion packages/helux-core/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@helux/core",
"version": "4.3.2",
"version": "4.3.5",
"description": "A reactive atomic state engine for React like.",
"bugs": {
"url": "https://github.com/heluxjs/helux/issues"
Expand Down
2 changes: 1 addition & 1 deletion packages/helux-core/src/consts/user.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { VER as limuVer } from 'limu';

export const VER = '4.3.2';
export const VER = '4.3.5';

export const LIMU_VER = limuVer;

Expand Down
16 changes: 10 additions & 6 deletions packages/helux-core/src/helpers/state.ts
Original file line number Diff line number Diff line change
Expand Up @@ -81,12 +81,16 @@ export function recordMod(sharedState: Dict, options: ParsedOptions) {
const existedShared = rootState[usefulName];
const existedInternal = getInternal(existedShared);
if (moduleName && existedInternal && existedInternal.loc !== options.loc) {
const locInfo = `\nloc1:${existedInternal.loc} \nloc2:${options.loc}`;
return warn(
`only-dev-mode tip: moduleName ${moduleName} duplicate! `
+ 'this does not effect helux but the duplicated module will be ignored by devtool'
+ locInfo,
);
// 非 loading 模块才提示
if (!moduleName.endsWith('@Loading')) {
const locInfo = `\nloc1:${existedInternal.loc} \nloc2:${options.loc}`;
warn(
`only-dev-mode tip: moduleName ${moduleName} duplicate! `
+ 'this does not effect helux but the duplicated module will be ignored by devtool'
+ locInfo,
);
}
return;
}
// may hot replace for dev mode or add new mod
rootState[usefulName] = sharedState;
Expand Down
2 changes: 1 addition & 1 deletion packages/helux-core/src/types/api.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ import type {
} from './base';

export declare const cst: {
VER: '4.2.7';
VER: '4.3.5';
LIMU_VER: string;
EVENT_NAME: {
/** 共享状态创建时的事件 */
Expand Down
2 changes: 1 addition & 1 deletion packages/helux-demo-utils/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
"dependencies": {
"@types/react": ">=16.0.0",
"@types/react-dom": ">=16.0.0",
"helux": "^4.3.2",
"helux": "^4.3.5",
"react": ">=16.10.2",
"react-dom": ">=16.10.2"
},
Expand Down
25 changes: 25 additions & 0 deletions packages/helux-hooks-impl/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,30 @@
# @helux/hooks-impl

## 4.3.5

### Patch Changes

- a17d460: mark ver as 4.3.5
- Updated dependencies [a17d460]
- @helux/types@4.3.5
- @helux/utils@4.3.5

## 4.3.4

### Patch Changes

- ef43031: ignore Loading dup tip
- Updated dependencies [ef43031]
- @helux/types@4.3.4
- @helux/utils@4.3.4

## 4.3.3

### Patch Changes

- @helux/types@4.3.3
- @helux/utils@4.3.3

## 4.3.2

### Patch Changes
Expand Down
2 changes: 1 addition & 1 deletion packages/helux-hooks-impl/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@helux/hooks-impl",
"version": "4.3.2",
"version": "4.3.5",
"description": "helux hooks implement lib",
"bugs": {
"url": "https://github.com/heluxjs/helux/issues"
Expand Down
28 changes: 28 additions & 0 deletions packages/helux-hooks/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,33 @@
# @helux/hooks

## 4.3.5

### Patch Changes

- a17d460: mark ver as 4.3.5
- Updated dependencies [a17d460]
- @helux/hooks-impl@4.3.5
- @helux/types@4.3.5
- @helux/utils@4.3.5

## 4.3.4

### Patch Changes

- ef43031: ignore Loading dup tip
- Updated dependencies [ef43031]
- @helux/hooks-impl@4.3.4
- @helux/types@4.3.4
- @helux/utils@4.3.4

## 4.3.3

### Patch Changes

- @helux/hooks-impl@4.3.3
- @helux/types@4.3.3
- @helux/utils@4.3.3

## 4.3.2

### Patch Changes
Expand Down
2 changes: 1 addition & 1 deletion packages/helux-hooks/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@helux/hooks",
"version": "4.3.2",
"version": "4.3.5",
"description": "helux hooks lib for react",
"keywords": [
"helux",
Expand Down
23 changes: 23 additions & 0 deletions packages/helux-openinula/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,28 @@
# @helux/openinula

## 4.3.5

### Patch Changes

- a17d460: mark ver as 4.3.5
- Updated dependencies [a17d460]
- @helux/core@4.3.5

## 4.3.4

### Patch Changes

- ef43031: ignore Loading dup tip
- Updated dependencies [ef43031]
- @helux/core@4.3.4

## 4.3.3

### Patch Changes

- Updated dependencies [8451c13]
- @helux/core@4.3.3

## 4.3.2

### Patch Changes
Expand Down
2 changes: 1 addition & 1 deletion packages/helux-openinula/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@helux/openinula",
"version": "4.3.2",
"version": "4.3.5",
"description": "State library for preact that integrates atom, signal, collection dep, derive and watch.",
"bugs": {
"url": "https://github.com/heluxjs/helux/issues"
Expand Down
8 changes: 5 additions & 3 deletions packages/helux-plugin-devtool/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@helux/plugin-devtool",
"version": "4.0.1",
"version": "4.0.3",
"description": "devtool for helux",
"bugs": {
"url": "https://github.com/heluxjs/helux/issues"
Expand Down Expand Up @@ -31,10 +31,12 @@
"test": "echo \"Error: no test specified\" && exit 1"
},
"dependencies": {
"helux": "workspace:^",
"helux": "^4.3.5",
"redux": "^4.2.1"
},
"peerDependencies": {},
"devDependencies": {
"terser": "^5.29.1"
},
"bundleDependencies": false,
"publishConfig": {
"access": "public",
Expand Down
12 changes: 7 additions & 5 deletions packages/helux-plugin-devtool/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,11 @@ const moduleInfoMap: Record<string, { name: string; state: any }> = {
[pluginName]: { name: pluginName, state: 'init helux devtool' }, // 避免调试时再刷新浏览器出现 no store 错误导致 devtool 无法启动
};

function getWindow() {
// @ts-ignore
return window || global;
}

function createReducer(module: string, initState = {}) {
return function (state: any, action: any) {
if (state === undefined) state = initState;
Expand All @@ -34,11 +39,8 @@ function tryInjectReduxDevTool() {
const redecers = createReducers();
if (!Object.keys(redecers).length) return;

reduxStore = createStore(
combineReducers(redecers),
// @ts-ignore
window.__REDUX_DEVTOOLS_EXTENSION__ && window.__REDUX_DEVTOOLS_EXTENSION__(),
);
const g = getWindow(); // global this
reduxStore = createStore(combineReducers(redecers), g.__REDUX_DEVTOOLS_EXTENSION__ && g.__REDUX_DEVTOOLS_EXTENSION__());
injected = true;

reduxStore.subscribe(function () {
Expand Down
14 changes: 14 additions & 0 deletions packages/helux-types/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,19 @@
# @helux/types

## 4.3.5

### Patch Changes

- a17d460: mark ver as 4.3.5

## 4.3.4

### Patch Changes

- ef43031: ignore Loading dup tip

## 4.3.3

## 4.3.2

## 4.3.1
Expand Down
2 changes: 1 addition & 1 deletion packages/helux-types/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@helux/types",
"version": "4.3.2",
"version": "4.3.5",
"description": "helux common types lib",
"keywords": [
"helux",
Expand Down
22 changes: 22 additions & 0 deletions packages/helux-utils/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,27 @@
# @helux/utils

## 4.3.5

### Patch Changes

- a17d460: mark ver as 4.3.5
- Updated dependencies [a17d460]
- @helux/types@4.3.5

## 4.3.4

### Patch Changes

- ef43031: ignore Loading dup tip
- Updated dependencies [ef43031]
- @helux/types@4.3.4

## 4.3.3

### Patch Changes

- @helux/types@4.3.3

## 4.3.2

### Patch Changes
Expand Down
2 changes: 1 addition & 1 deletion packages/helux-utils/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@helux/utils",
"version": "4.3.2",
"version": "4.3.5",
"description": "helux utils lib",
"keywords": [
"helux",
Expand Down
23 changes: 23 additions & 0 deletions packages/helux/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,28 @@
# helux

## 4.3.5

### Patch Changes

- a17d460: mark ver as 4.3.5
- Updated dependencies [a17d460]
- @helux/core@4.3.5

## 4.3.4

### Patch Changes

- ef43031: ignore Loading dup tip
- Updated dependencies [ef43031]
- @helux/core@4.3.4

## 4.3.3

### Patch Changes

- Updated dependencies [8451c13]
- @helux/core@4.3.3

## 4.3.2

### Patch Changes
Expand Down
2 changes: 1 addition & 1 deletion packages/helux/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "helux",
"version": "4.3.2",
"version": "4.3.5",
"description": "A reactive atomic state engine for React( including React 18).",
"bugs": {
"url": "https://github.com/heluxjs/helux/issues"
Expand Down
Loading

0 comments on commit 8f665a7

Please sign in to comment.