@variousjs/various 1.0.1 → 2.1.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/dist/core.js +1 -1
- package/dist/core.js.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/index.d.ts +16 -8
- package/package.json +31 -29
package/index.d.ts
CHANGED
|
@@ -10,26 +10,24 @@ declare module '@variousjs/various' {
|
|
|
10
10
|
target: Element | null,
|
|
11
11
|
onMounted?: () => void,
|
|
12
12
|
}) => () => void
|
|
13
|
-
type $preload = (names: string[]) => Promise<void>
|
|
14
13
|
type $postMessage = (name: string, value?: any) => void
|
|
15
|
-
type $
|
|
14
|
+
type $t = (key: string, params?: Record<string, string | number>) => string | undefined
|
|
16
15
|
|
|
17
|
-
export { default as Store,
|
|
16
|
+
export { default as Store, Dispatch } from 'nycticorax'
|
|
18
17
|
|
|
19
18
|
export interface ComponentProps<S = {}, C = {}> {
|
|
20
19
|
$config: Readonly<C>,
|
|
21
20
|
$store: Readonly<S>,
|
|
22
21
|
$dispatch: $dispatch,
|
|
23
22
|
$render?: $render,
|
|
24
|
-
$preload: $preload,
|
|
25
23
|
$postMessage: $postMessage,
|
|
26
|
-
$
|
|
24
|
+
$t: $t,
|
|
27
25
|
}
|
|
28
26
|
|
|
29
27
|
export interface ErrorProps {
|
|
30
|
-
reload?: () => void,
|
|
31
|
-
type: 'LOADING_ERROR' | 'DEPENDENCIES_LOADING_ERROR' | 'NOT_DEFINED' | 'INVALID_COMPONENT' | 'SCRIPT_ERROR' | 'CONTAINER_ERROR',
|
|
32
|
-
message?: string,
|
|
28
|
+
$reload?: () => void,
|
|
29
|
+
$type: 'LOADING_ERROR' | 'DEPENDENCIES_LOADING_ERROR' | 'NOT_DEFINED' | 'INVALID_COMPONENT' | 'SCRIPT_ERROR' | 'CONTAINER_ERROR',
|
|
30
|
+
$message?: string,
|
|
33
31
|
}
|
|
34
32
|
|
|
35
33
|
export interface ContainerProps<C = {}> {
|
|
@@ -52,4 +50,14 @@ declare module '@variousjs/various' {
|
|
|
52
50
|
) => any
|
|
53
51
|
|
|
54
52
|
export type Invoker = (params: { trigger: string, value?: any }) => any
|
|
53
|
+
|
|
54
|
+
export type Ii8n = () => {
|
|
55
|
+
localeKey: string,
|
|
56
|
+
resources: Record<string, Record<string, string>>,
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
export const isComponentLoaded: (name: string) => boolean
|
|
60
|
+
export const getMountedComponents: () => string[]
|
|
61
|
+
export const preloadComponents: (names: string[]) => Promise<void>
|
|
62
|
+
export const onComponentMounted: (name: string, callback: () => void) => () => void
|
|
55
63
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@variousjs/various",
|
|
3
|
-
"version": "1.0
|
|
3
|
+
"version": "2.1.0",
|
|
4
4
|
"description": "RequireJS(AMD) + React",
|
|
5
5
|
"files": [
|
|
6
6
|
"dist",
|
|
@@ -23,7 +23,7 @@
|
|
|
23
23
|
"start": "webpack --config webpack/components.js --progress & webpack serve --config webpack/index.js --progress",
|
|
24
24
|
"prebuild": "npm run lint",
|
|
25
25
|
"build": "NODE_ENV=production webpack --config webpack/index.js --progress",
|
|
26
|
-
"cy:run": "cypress run",
|
|
26
|
+
"cy:run": "rm -rf .nyc_output && cypress run",
|
|
27
27
|
"ci": "start-server-and-test start http://127.0.0.1:2333 cy:run",
|
|
28
28
|
"cypress": "cypress open"
|
|
29
29
|
},
|
|
@@ -43,36 +43,38 @@
|
|
|
43
43
|
},
|
|
44
44
|
"homepage": "https://github.com/variousjs/various#readme",
|
|
45
45
|
"devDependencies": {
|
|
46
|
-
"@babel/core": "^7.
|
|
47
|
-
"@babel/
|
|
48
|
-
"@babel/preset-
|
|
49
|
-
"@babel/preset-
|
|
50
|
-
"@babel/
|
|
51
|
-
"@
|
|
52
|
-
"@
|
|
53
|
-
"@types/react
|
|
54
|
-
"@types/react-
|
|
55
|
-
"@types/
|
|
56
|
-
"@
|
|
57
|
-
"@typescript-eslint/
|
|
58
|
-
"
|
|
46
|
+
"@babel/core": "^7.18.10",
|
|
47
|
+
"@babel/plugin-transform-runtime": "^7.18.10",
|
|
48
|
+
"@babel/preset-env": "^7.18.10",
|
|
49
|
+
"@babel/preset-react": "^7.18.6",
|
|
50
|
+
"@babel/preset-typescript": "^7.18.6",
|
|
51
|
+
"@babel/runtime": "^7.18.9",
|
|
52
|
+
"@cypress/code-coverage": "^3.10.0",
|
|
53
|
+
"@types/react": "^18.0.15",
|
|
54
|
+
"@types/react-dom": "^18.0.6",
|
|
55
|
+
"@types/react-router-dom": "^5.3.3",
|
|
56
|
+
"@types/requirejs": "^2.1.34",
|
|
57
|
+
"@typescript-eslint/eslint-plugin": "^4.33.0",
|
|
58
|
+
"@typescript-eslint/parser": "^4.33.0",
|
|
59
|
+
"babel-loader": "^8.2.5",
|
|
59
60
|
"babel-plugin-istanbul": "^6.1.1",
|
|
60
|
-
"
|
|
61
|
-
"
|
|
61
|
+
"core-js": "^3.25.0",
|
|
62
|
+
"cypress": "^9.7.0",
|
|
63
|
+
"eslint": "^7.32.0",
|
|
62
64
|
"eslint-config-airbnb": "^18.2.1",
|
|
63
|
-
"eslint-import-resolver-typescript": "^2.
|
|
65
|
+
"eslint-import-resolver-typescript": "^2.7.1",
|
|
64
66
|
"eslint-plugin-cypress": "^2.12.1",
|
|
65
|
-
"eslint-plugin-import": "^2.
|
|
66
|
-
"eslint-plugin-jsx-a11y": "^6.
|
|
67
|
-
"eslint-plugin-react": "^7.
|
|
68
|
-
"eslint-plugin-react-hooks": "^4.
|
|
67
|
+
"eslint-plugin-import": "^2.26.0",
|
|
68
|
+
"eslint-plugin-jsx-a11y": "^6.6.1",
|
|
69
|
+
"eslint-plugin-react": "^7.30.1",
|
|
70
|
+
"eslint-plugin-react-hooks": "^4.6.0",
|
|
71
|
+
"nycticorax": "^4.1.0",
|
|
69
72
|
"start-server-and-test": "^1.14.0",
|
|
70
|
-
"typescript": "^4.4.
|
|
71
|
-
"webpack": "^5.
|
|
72
|
-
"webpack-
|
|
73
|
-
"webpack-
|
|
73
|
+
"typescript": "^4.4.4",
|
|
74
|
+
"webpack": "^5.74.0",
|
|
75
|
+
"webpack-bundle-analyzer": "^4.6.1",
|
|
76
|
+
"webpack-cli": "^4.10.0",
|
|
77
|
+
"webpack-dev-server": "^4.9.3"
|
|
74
78
|
},
|
|
75
|
-
"dependencies": {
|
|
76
|
-
"nycticorax": "^3.0.3"
|
|
77
|
-
}
|
|
79
|
+
"dependencies": {}
|
|
78
80
|
}
|