@variousjs/various 1.1.0 → 2.1.1

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/index.d.ts CHANGED
@@ -10,21 +10,17 @@ 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 $getMountedComponents = () => string[]
16
- type $t = (key: string, defaultText?: string) => string | undefined
14
+ type $t = (key: string, params?: Record<string, string | number>) => string | undefined
17
15
 
18
- export { default as Store, Connect, Dispatch } from 'nycticorax'
16
+ export { default as Store, Dispatch } from 'nycticorax'
19
17
 
20
18
  export interface ComponentProps<S = {}, C = {}> {
21
19
  $config: Readonly<C>,
22
20
  $store: Readonly<S>,
23
21
  $dispatch: $dispatch,
24
22
  $render?: $render,
25
- $preload: $preload,
26
23
  $postMessage: $postMessage,
27
- $getMountedComponents: $getMountedComponents,
28
24
  $t: $t,
29
25
  }
30
26
 
@@ -59,4 +55,9 @@ declare module '@variousjs/various' {
59
55
  localeKey: string,
60
56
  resources: Record<string, Record<string, string>>,
61
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
62
63
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@variousjs/various",
3
- "version": "1.1.0",
3
+ "version": "2.1.1",
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.14.6",
47
- "@babel/preset-env": "^7.14.7",
48
- "@babel/preset-react": "^7.14.5",
49
- "@babel/preset-typescript": "^7.14.5",
50
- "@babel/runtime-corejs3": "^7.14.8",
51
- "@cypress/code-coverage": "^3.9.12",
52
- "@types/react": "^17.0.27",
53
- "@types/react-dom": "^17.0.9",
54
- "@types/react-router-dom": "^5.3.2",
55
- "@types/requirejs": "^2.1.33",
56
- "@typescript-eslint/eslint-plugin": "^4.31.0",
57
- "@typescript-eslint/parser": "^4.31.0",
58
- "babel-loader": "^8.2.2",
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
- "cypress": "^9.4.1",
61
- "eslint": "^7.31.0",
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.4.0",
65
+ "eslint-import-resolver-typescript": "^2.7.1",
64
66
  "eslint-plugin-cypress": "^2.12.1",
65
- "eslint-plugin-import": "^2.23.4",
66
- "eslint-plugin-jsx-a11y": "^6.4.1",
67
- "eslint-plugin-react": "^7.24.0",
68
- "eslint-plugin-react-hooks": "^4.2.0",
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.2",
71
- "webpack": "^5.60.0",
72
- "webpack-cli": "^4.9.1",
73
- "webpack-dev-server": "^4.7.3"
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
  }