@variousjs/various 0.0.2 → 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +3 -18
- package/dist/core.js +3 -0
- package/dist/core.js.LICENSE.txt +8 -0
- package/dist/core.js.map +1 -0
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/package.json +11 -14
- package/types/index.d.ts +15 -4
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@variousjs/various",
|
|
3
|
-
"version": "0.0
|
|
3
|
+
"version": "0.3.0",
|
|
4
4
|
"description": "RequireJS(AMD) + React",
|
|
5
5
|
"files": [
|
|
6
6
|
"dist",
|
|
@@ -13,16 +13,9 @@
|
|
|
13
13
|
"types": "types/index.d.ts",
|
|
14
14
|
"scripts": {
|
|
15
15
|
"lint": "tsc --noemit && eslint . --ext .ts,.tsx,.js",
|
|
16
|
-
"
|
|
17
|
-
"
|
|
18
|
-
"
|
|
19
|
-
"c": "ENTRY=demo/components/c.tsx webpack --progress",
|
|
20
|
-
"d": "ENTRY=demo/components/d.tsx webpack --progress",
|
|
21
|
-
"e": "ENTRY=demo/components/e.tsx webpack --progress",
|
|
22
|
-
"f": "ENTRY=demo/components/f.tsx webpack --progress",
|
|
23
|
-
"m": "ENTRY=demo/components/m.tsx webpack --progress",
|
|
24
|
-
"hooks": "ENTRY=demo/components/hooks.tsx webpack --progress",
|
|
25
|
-
"entry": "ENTRY=demo/entry.ts webpack --progress"
|
|
16
|
+
"start": "webpack --config webpack/components.js --progress & webpack serve --config webpack/index.js --progress",
|
|
17
|
+
"build": "NODE_ENV=production webpack --progress --config webpack/components.js && NODE_ENV=production webpack --config webpack/index.js --progress",
|
|
18
|
+
"postbuild": "cp -R dist/ docs/dist/"
|
|
26
19
|
},
|
|
27
20
|
"repository": {
|
|
28
21
|
"type": "git",
|
|
@@ -59,9 +52,13 @@
|
|
|
59
52
|
"eslint-plugin-jsx-a11y": "^6.4.1",
|
|
60
53
|
"eslint-plugin-react": "^7.24.0",
|
|
61
54
|
"eslint-plugin-react-hooks": "^4.2.0",
|
|
62
|
-
"nycticorax": "^2.0.6",
|
|
63
55
|
"typescript": "^4.4.2",
|
|
64
|
-
"webpack": "^5.
|
|
65
|
-
"webpack-cli": "^4.
|
|
56
|
+
"webpack": "^5.60.0",
|
|
57
|
+
"webpack-cli": "^4.9.1",
|
|
58
|
+
"webpack-dev-server": "^4.3.1"
|
|
59
|
+
},
|
|
60
|
+
"dependencies": {
|
|
61
|
+
"nycticorax": "^2.0.6",
|
|
62
|
+
"react-router-dom": "^5.3.0"
|
|
66
63
|
}
|
|
67
64
|
}
|
package/types/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
declare module '@variousjs/various' {
|
|
2
2
|
import { RouteComponentProps } from 'react-router-dom'
|
|
3
|
-
import { ComponentType,
|
|
3
|
+
import { ComponentType, Component } from 'react'
|
|
4
4
|
|
|
5
5
|
type $dispatch = (type: string, method: string, value?: any) => unknown
|
|
6
6
|
type $render = (params: {
|
|
@@ -13,6 +13,18 @@ declare module '@variousjs/various' {
|
|
|
13
13
|
}) => () => void
|
|
14
14
|
type $preload = (names: string[]) => Promise<void>
|
|
15
15
|
|
|
16
|
+
export { default as Store, Connect, Dispatch } from 'nycticorax'
|
|
17
|
+
|
|
18
|
+
export class Router extends Component {}
|
|
19
|
+
export {
|
|
20
|
+
Route,
|
|
21
|
+
Link,
|
|
22
|
+
generatePath,
|
|
23
|
+
Redirect,
|
|
24
|
+
Prompt,
|
|
25
|
+
NavLink,
|
|
26
|
+
} from 'react-router-dom'
|
|
27
|
+
|
|
16
28
|
export interface ComponentProps<S = {}, C = {}> {
|
|
17
29
|
$config: Readonly<C>,
|
|
18
30
|
$mounted: string[],
|
|
@@ -30,7 +42,6 @@ declare module '@variousjs/various' {
|
|
|
30
42
|
}
|
|
31
43
|
|
|
32
44
|
export interface ContainerProps<S = {}, C = {}> {
|
|
33
|
-
Router: ComponentType<{ children?: ReactNode }>,
|
|
34
45
|
$config: Readonly<C>,
|
|
35
46
|
$component: (name: string) => ComponentType<{
|
|
36
47
|
silent?: boolean,
|
|
@@ -44,13 +55,13 @@ declare module '@variousjs/various' {
|
|
|
44
55
|
$router: RouteComponentProps<{ [key: string]: string }>,
|
|
45
56
|
}
|
|
46
57
|
|
|
47
|
-
type
|
|
58
|
+
type Store<S> = {
|
|
48
59
|
getStore: () => S,
|
|
49
60
|
dispatch: (next: Partial<S>) => void,
|
|
50
61
|
}
|
|
51
62
|
|
|
52
63
|
export type Actions<S = {}> = {
|
|
53
|
-
[name: string]: (
|
|
64
|
+
[name: string]: (store: Store<S>, ...args: any[]) => unknown,
|
|
54
65
|
}
|
|
55
66
|
|
|
56
67
|
export interface Config {
|