@variousjs/various 5.0.0 → 5.0.2
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/index.dev.js +59 -19
- package/dist/index.dev.js.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/loader-dev.js +2319 -0
- package/dist/loader-dev.js.map +1 -0
- package/dist/loader.js +1 -1
- package/dist/loader.js.map +1 -1
- package/index.d.ts +20 -20
- package/package.json +13 -6
package/index.d.ts
CHANGED
|
@@ -2,6 +2,7 @@ declare module '@variousjs/various' {
|
|
|
2
2
|
import {
|
|
3
3
|
ComponentType, FC, ReactNode, RefObject,
|
|
4
4
|
} from 'react'
|
|
5
|
+
import { PropType } from 'vue'
|
|
5
6
|
|
|
6
7
|
export { default as Nycticorax, Dispatch } from 'nycticorax'
|
|
7
8
|
|
|
@@ -62,6 +63,15 @@ declare module '@variousjs/various' {
|
|
|
62
63
|
update: (config: Partial<I18nConfig>, type?: 'app') => void,
|
|
63
64
|
}
|
|
64
65
|
|
|
66
|
+
interface ComponentBuiltinProps<S extends object = ObjectRecord> {
|
|
67
|
+
$store: Readonly<S>,
|
|
68
|
+
$dispatch: $dispatch,
|
|
69
|
+
$postMessage: $postMessage,
|
|
70
|
+
$t: Intl,
|
|
71
|
+
$logger: $logger,
|
|
72
|
+
$self: ModuleDefined & { url: string },
|
|
73
|
+
}
|
|
74
|
+
|
|
65
75
|
export type PublicAction = (value: any, trigger: ModuleDefined) => any
|
|
66
76
|
|
|
67
77
|
export interface I18nConfig {
|
|
@@ -83,13 +93,7 @@ declare module '@variousjs/various' {
|
|
|
83
93
|
export type ComponentProps<
|
|
84
94
|
S extends object = ObjectRecord,
|
|
85
95
|
P extends object = ObjectRecord
|
|
86
|
-
> =
|
|
87
|
-
$store: Readonly<S>,
|
|
88
|
-
$dispatch: $dispatch,
|
|
89
|
-
$postMessage: $postMessage,
|
|
90
|
-
$t: Intl,
|
|
91
|
-
$logger: $logger,
|
|
92
|
-
} & P
|
|
96
|
+
> = ComponentBuiltinProps<S> & P
|
|
93
97
|
|
|
94
98
|
export type ComponentNode<
|
|
95
99
|
S extends object = {},
|
|
@@ -100,15 +104,13 @@ declare module '@variousjs/various' {
|
|
|
100
104
|
$reload: () => void,
|
|
101
105
|
$error: VariousError,
|
|
102
106
|
$store: Readonly<S>,
|
|
103
|
-
$
|
|
104
|
-
$module?: ModuleDefined['module'],
|
|
107
|
+
$self: ModuleDefined & { url?: string },
|
|
105
108
|
}
|
|
106
109
|
export type ErrorNode<S extends object = ObjectRecord> = ComponentType<ErrorNodeProps<S>>
|
|
107
110
|
|
|
108
111
|
export interface LoaderNodeProps<S extends object = ObjectRecord> {
|
|
109
112
|
$store: Readonly<S>,
|
|
110
|
-
$
|
|
111
|
-
$module?: ModuleDefined['module'],
|
|
113
|
+
$self: ModuleDefined & { url?: string },
|
|
112
114
|
}
|
|
113
115
|
export type LoaderNode<S extends object = ObjectRecord> = ComponentType<LoaderNodeProps<S>>
|
|
114
116
|
|
|
@@ -188,7 +190,10 @@ declare module '@variousjs/various' {
|
|
|
188
190
|
S extends object = ObjectRecord,
|
|
189
191
|
P extends object = ObjectRecord
|
|
190
192
|
>(
|
|
191
|
-
config: ModuleDefined & {
|
|
193
|
+
config: ModuleDefined & {
|
|
194
|
+
url?: string,
|
|
195
|
+
type?: VariousComponentType,
|
|
196
|
+
},
|
|
192
197
|
storeKeys?: (keyof S)[],
|
|
193
198
|
): ComponentType<ComponentDefaultProps & P>
|
|
194
199
|
|
|
@@ -205,17 +210,12 @@ declare module '@variousjs/various' {
|
|
|
205
210
|
onMounted?: () => void,
|
|
206
211
|
}): () => Promise<void>
|
|
207
212
|
|
|
208
|
-
export
|
|
209
|
-
$dispatch: $dispatch,
|
|
210
|
-
$logger: $logger,
|
|
211
|
-
$postMessage: $postMessage,
|
|
212
|
-
$t: Intl,
|
|
213
|
-
$store: Readonly<S>,
|
|
214
|
-
}
|
|
213
|
+
export type VueVarious<S extends object = ObjectRecord> = PropType<ComponentBuiltinProps<S>>
|
|
215
214
|
|
|
216
215
|
export const isModuleLoaded: (name: string) => boolean
|
|
216
|
+
export const removeLoadedModules: (names: string[]) => void
|
|
217
217
|
export const getMountedComponents: () => ModuleDefined[]
|
|
218
|
-
export const preloadModules: (name: string
|
|
218
|
+
export const preloadModules: (name: string[]) => Promise<void>
|
|
219
219
|
export const onComponentMounted: (
|
|
220
220
|
name: ModuleDefined | ModuleDefined[], callback: () => void
|
|
221
221
|
) => (() => void) | void
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@variousjs/various",
|
|
3
|
-
"version": "5.0.
|
|
3
|
+
"version": "5.0.2",
|
|
4
4
|
"description": "RequireJS(AMD) + React",
|
|
5
5
|
"files": [
|
|
6
6
|
"dist",
|
|
@@ -19,11 +19,19 @@
|
|
|
19
19
|
"types": "index.d.ts",
|
|
20
20
|
"scripts": {
|
|
21
21
|
"lint": "tsc --noemit && eslint . --ext .ts,.tsx,.js",
|
|
22
|
-
"
|
|
23
|
-
"
|
|
22
|
+
"create-empty": "touch docs/dist/empty.js",
|
|
23
|
+
"test-components": "webpack --config webpack/test-components.js --progress",
|
|
24
|
+
"test-components:build": "NODE_ENV=production webpack --config webpack/test-components.js --progress",
|
|
25
|
+
"package-core": "webpack --config webpack/package-core.js --progress",
|
|
26
|
+
"package-core:build": "NODE_ENV=production webpack --config webpack/package-core.js --progress",
|
|
27
|
+
"package-loader": "webpack serve --config webpack/package-loader.js --progress --no-client-overlay",
|
|
28
|
+
"package-loader:build": "NODE_ENV=production webpack --config webpack/package-loader.js --progress",
|
|
29
|
+
"prestart": "mkdir -p docs/dist && npm run create-empty",
|
|
30
|
+
"start": "npm run test-components & npm run package-core & npm run package-loader",
|
|
31
|
+
"build": "npm run test-components:build && npm run package-core:build && npm run package-loader:build",
|
|
24
32
|
"prebuild": "npm run lint && rm -rf dist && rm -rf docs/dist",
|
|
25
|
-
"
|
|
26
|
-
"
|
|
33
|
+
"postbuild": "npm run create-empty",
|
|
34
|
+
"prepublishOnly": "npm run build",
|
|
27
35
|
"cy:run": "rm -rf .nyc_output && cypress run",
|
|
28
36
|
"ci": "start-server-and-test start http://127.0.0.1:2333 cy:run",
|
|
29
37
|
"cypress": "cypress open"
|
|
@@ -74,7 +82,6 @@
|
|
|
74
82
|
"vue": "^3.5.21",
|
|
75
83
|
"vue-loader": "^17.3.1",
|
|
76
84
|
"webpack": "^5.101.0",
|
|
77
|
-
"webpack-bundle-analyzer": "^4.6.1",
|
|
78
85
|
"webpack-cli": "^4.10.0",
|
|
79
86
|
"webpack-dev-server": "^4.9.3"
|
|
80
87
|
},
|