@koeroesi86/react-reviver 21.4.26-9aec7d3 → 23.3.4329600818-main
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/.github/workflows/build.yml +34 -0
- package/.github/workflows/publish.yml +37 -0
- package/dist/dts.config.d.ts +2 -0
- package/dist/index.d.ts +24 -9
- package/dist/jest.config.d.ts +7 -0
- package/dist/package/index.js +1 -1
- package/dist/webpack.config.d.ts +69 -0
- package/package.json +30 -28
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
name: Branch build
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
pull_request:
|
|
5
|
+
branches:
|
|
6
|
+
- main
|
|
7
|
+
|
|
8
|
+
jobs:
|
|
9
|
+
build:
|
|
10
|
+
runs-on: ubuntu-latest
|
|
11
|
+
steps:
|
|
12
|
+
- uses: actions/checkout@v3
|
|
13
|
+
- uses: actions/setup-node@v3
|
|
14
|
+
with:
|
|
15
|
+
node-version: '18'
|
|
16
|
+
cache: 'yarn'
|
|
17
|
+
- name: Persist cache
|
|
18
|
+
uses: actions/cache@v3
|
|
19
|
+
id: local-dot-cache
|
|
20
|
+
with:
|
|
21
|
+
path: .cache
|
|
22
|
+
key: ${{ runner.os }}-local-dot-cache-${{ hashFiles('**/yarn.lock') }}
|
|
23
|
+
- name: Setup
|
|
24
|
+
run: yarn install --frozen-lockfile
|
|
25
|
+
- name: Lint
|
|
26
|
+
run: yarn lint
|
|
27
|
+
- name: Test
|
|
28
|
+
run: yarn test
|
|
29
|
+
- name: Package version
|
|
30
|
+
run: yarn generate-version
|
|
31
|
+
- name: Package bundle
|
|
32
|
+
run: yarn build
|
|
33
|
+
- name: Package information
|
|
34
|
+
run: npm publish --dry-run
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
name: Publish
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches:
|
|
6
|
+
- main
|
|
7
|
+
|
|
8
|
+
jobs:
|
|
9
|
+
publish:
|
|
10
|
+
runs-on: ubuntu-latest
|
|
11
|
+
steps:
|
|
12
|
+
- uses: actions/checkout@v3
|
|
13
|
+
- uses: actions/setup-node@v3
|
|
14
|
+
with:
|
|
15
|
+
node-version: '18'
|
|
16
|
+
cache: 'yarn'
|
|
17
|
+
registry-url: 'https://registry.npmjs.org'
|
|
18
|
+
- name: Persist cache
|
|
19
|
+
uses: actions/cache@v3
|
|
20
|
+
id: local-dot-cache
|
|
21
|
+
with:
|
|
22
|
+
path: .cache
|
|
23
|
+
key: ${{ runner.os }}-local-dot-cache-${{ hashFiles('**/yarn.lock') }}
|
|
24
|
+
- name: Setup
|
|
25
|
+
run: yarn install --frozen-lockfile
|
|
26
|
+
- name: Lint
|
|
27
|
+
run: yarn lint
|
|
28
|
+
- name: Test
|
|
29
|
+
run: yarn test
|
|
30
|
+
- name: Package version
|
|
31
|
+
run: yarn generate-version
|
|
32
|
+
- name: Package bundle
|
|
33
|
+
run: yarn build
|
|
34
|
+
- name: Publish package
|
|
35
|
+
run: npm publish
|
|
36
|
+
env:
|
|
37
|
+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,22 +1,21 @@
|
|
|
1
|
-
// Generated by dts-bundle-generator
|
|
1
|
+
// Generated by dts-bundle-generator v7.2.0
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
/// <reference types="scheduler" />
|
|
3
|
+
import * as PropTypes from 'prop-types';
|
|
4
|
+
import React from 'react';
|
|
6
5
|
|
|
7
|
-
export
|
|
6
|
+
export type RevivableComponentLike = RevivableComponentType;
|
|
8
7
|
export interface RevivableComponentType<T = string, P = object, C extends RevivableComponentLike = RevivableComponentLike> {
|
|
9
8
|
type: T;
|
|
10
9
|
id?: string;
|
|
11
10
|
props?: P;
|
|
12
11
|
children?: C[];
|
|
13
12
|
}
|
|
14
|
-
export
|
|
13
|
+
export type RevivableReactComponent = string | ((props: any, context?: any) => any) | (new (props: any, context?: any) => any);
|
|
15
14
|
export interface ComponentRegistry {
|
|
16
15
|
[type: string]: RevivableReactComponent;
|
|
17
16
|
}
|
|
18
17
|
export interface RegistryContextType {
|
|
19
|
-
resolve: (alias: string) =>
|
|
18
|
+
resolve: (alias: string) => ComponentRegistry[typeof alias];
|
|
20
19
|
}
|
|
21
20
|
export interface ReviverRegistryProviderProps {
|
|
22
21
|
components: {
|
|
@@ -24,11 +23,27 @@ export interface ReviverRegistryProviderProps {
|
|
|
24
23
|
};
|
|
25
24
|
children: React.ReactNode;
|
|
26
25
|
}
|
|
27
|
-
declare
|
|
26
|
+
declare function ReviverRegistryProvider({ children, components, }: ReviverRegistryProviderProps): JSX.Element;
|
|
27
|
+
declare namespace ReviverRegistryProvider {
|
|
28
|
+
var propTypes: {
|
|
29
|
+
components: PropTypes.Validator<{
|
|
30
|
+
[x: string]: PropTypes.ReactComponentLike;
|
|
31
|
+
}>;
|
|
32
|
+
children: PropTypes.Requireable<PropTypes.ReactNodeLike>;
|
|
33
|
+
};
|
|
34
|
+
var defaultProps: {
|
|
35
|
+
children: any;
|
|
36
|
+
};
|
|
37
|
+
}
|
|
28
38
|
export interface LayoutProps {
|
|
29
39
|
data: RevivableComponentType[] | RevivableComponentType;
|
|
30
40
|
}
|
|
31
|
-
export declare
|
|
41
|
+
export declare function ReviverLayout({ data }: LayoutProps): JSX.Element;
|
|
42
|
+
export declare namespace ReviverLayout {
|
|
43
|
+
var propTypes: {
|
|
44
|
+
data: PropTypes.Validator<NonNullable<NonNullable<PropTypes.InferProps<PropTypes.ValidationMap<RevivableComponentType<string, object, RevivableComponentLike>>> | PropTypes.InferProps<PropTypes.ValidationMap<RevivableComponentType<string, object, RevivableComponentLike>>>[]>>>;
|
|
45
|
+
};
|
|
46
|
+
}
|
|
32
47
|
|
|
33
48
|
export {
|
|
34
49
|
ReviverRegistryProvider as ReviverProvider,
|
package/dist/package/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(()=>{var e={703:(e,r,t)=>{"use strict";var n=t(414);function o(){}function s(){}s.resetWarningCache=o,e.exports=function(){function e(e,r,t,o,s,a){if(a!==n){var i=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw i.name="Invariant Violation",i}}function r(){return e}e.isRequired=e;var t={array:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:r,element:e,elementType:e,instanceOf:r,node:e,objectOf:r,oneOf:r,oneOfType:r,shape:r,exact:r,checkPropTypes:s,resetWarningCache:o};return t.PropTypes=t,t}},697:(e,r,t)=>{e.exports=t(703)()},414:e=>{"use strict";e.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"}},r={};function t(n){var o=r[n];if(void 0!==o)return o.exports;var s=r[n]={exports:{}};return e[n](s,s.exports,t),s.exports}t.n=e=>{var r=e&&e.__esModule?()=>e.default:()=>e;return t.d(r,{a:r}),r},t.d=(e,r)=>{for(var n in r)t.o(r,n)&&!t.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:r[n]})},t.o=(e,r)=>Object.prototype.hasOwnProperty.call(e,r),t.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var n={};(()=>{"use strict";t.r(n),t.d(n,{ReviverLayout:()=>
|
|
1
|
+
(()=>{var e={703:(e,r,t)=>{"use strict";var n=t(414);function o(){}function s(){}s.resetWarningCache=o,e.exports=function(){function e(e,r,t,o,s,a){if(a!==n){var i=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw i.name="Invariant Violation",i}}function r(){return e}e.isRequired=e;var t={array:e,bigint:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:r,element:e,elementType:e,instanceOf:r,node:e,objectOf:r,oneOf:r,oneOfType:r,shape:r,exact:r,checkPropTypes:s,resetWarningCache:o};return t.PropTypes=t,t}},697:(e,r,t)=>{e.exports=t(703)()},414:e=>{"use strict";e.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"}},r={};function t(n){var o=r[n];if(void 0!==o)return o.exports;var s=r[n]={exports:{}};return e[n](s,s.exports,t),s.exports}t.n=e=>{var r=e&&e.__esModule?()=>e.default:()=>e;return t.d(r,{a:r}),r},t.d=(e,r)=>{for(var n in r)t.o(r,n)&&!t.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:r[n]})},t.o=(e,r)=>Object.prototype.hasOwnProperty.call(e,r),t.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var n={};(()=>{"use strict";t.r(n),t.d(n,{ReviverLayout:()=>S,ReviverProvider:()=>c});const e=require("react");var r=t.n(e),o=t(697),s=t.n(o);class a{constructor(e){this.resolve=e=>this.components[e]?this.components[e]:(console.warn(`Alias not registered: ${e}`),()=>null),this.components=e}}const i=new a({}),p=r().createContext(i);function c({children:t,components:n}){const o=(0,e.useMemo)((()=>new a(n)),[n]);return r().createElement(p.Provider,{value:o},t)}c.propTypes={components:s().objectOf(s().elementType).isRequired,children:s().node},c.defaultProps={children:null};const l=()=>(0,e.useContext)(p),u=require("crypto");var d=t.n(u);const y={randomUUID:d().randomUUID},f=new Uint8Array(256);let m=f.length;function h(){return m>f.length-16&&(d().randomFillSync(f),m=0),f.slice(m,m+=16)}const v=[];for(let e=0;e<256;++e)v.push((e+256).toString(16).slice(1));const O=function(e,r,t){if(y.randomUUID&&!r&&!e)return y.randomUUID();const n=(e=e||{}).random||(e.rng||h)();if(n[6]=15&n[6]|64,n[8]=63&n[8]|128,r){t=t||0;for(let e=0;e<16;++e)r[t+e]=n[e];return r}return function(e,r=0){return(v[e[r+0]]+v[e[r+1]]+v[e[r+2]]+v[e[r+3]]+"-"+v[e[r+4]]+v[e[r+5]]+"-"+v[e[r+6]]+v[e[r+7]]+"-"+v[e[r+8]]+v[e[r+9]]+"-"+v[e[r+10]]+v[e[r+11]]+v[e[r+12]]+v[e[r+13]]+v[e[r+14]]+v[e[r+15]]).toLowerCase()}(n)},g={type:o.string.isRequired,id:o.string,props:o.shape({}),children:o.arrayOf(o.shape({}))},T=o.shape(g),b=o.arrayOf(T);function P({type:e,props:t,children:n}){const o=l().resolve(e);return r().createElement(o,{...t},n)}P.propTypes={type:o.string.isRequired,props:o.shape({}),children:o.oneOfType([o.element,o.arrayOf(o.element)])},P.defaultProps={props:{},children:null};const _=P;function R({children:e}){return r().createElement(r().Fragment,null,e&&e.map((e=>r().createElement(_,{type:e.type,props:e.props,key:`ChildrenReviver-${e.type}-${e.id||O()}`},r().createElement(R,null,e.children)))))}R.propTypes={children:b},R.defaultProps={children:[]};const x=R;function E({data:e}){return r().createElement(x,null,Array.isArray(e)?e:[e])}E.propTypes={data:o.oneOfType([T,o.arrayOf(T)]).isRequired};const S=E})(),module.exports=n})();
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
declare const _exports: ({
|
|
2
|
+
mode: string;
|
|
3
|
+
entry: {
|
|
4
|
+
index: string;
|
|
5
|
+
example?: undefined;
|
|
6
|
+
};
|
|
7
|
+
target: string;
|
|
8
|
+
devtool: boolean;
|
|
9
|
+
cache: {
|
|
10
|
+
type: string;
|
|
11
|
+
cacheDirectory: string;
|
|
12
|
+
};
|
|
13
|
+
watchOptions: {
|
|
14
|
+
poll: number;
|
|
15
|
+
};
|
|
16
|
+
output: {
|
|
17
|
+
path: string;
|
|
18
|
+
filename: string;
|
|
19
|
+
library: {
|
|
20
|
+
type: string;
|
|
21
|
+
};
|
|
22
|
+
};
|
|
23
|
+
resolve: {
|
|
24
|
+
extensions: string[];
|
|
25
|
+
plugins: TsconfigPathsPlugin[];
|
|
26
|
+
};
|
|
27
|
+
module: {
|
|
28
|
+
rules: {
|
|
29
|
+
test: RegExp;
|
|
30
|
+
use: string;
|
|
31
|
+
exclude: RegExp;
|
|
32
|
+
}[];
|
|
33
|
+
};
|
|
34
|
+
externals: string[];
|
|
35
|
+
} | {
|
|
36
|
+
mode: string;
|
|
37
|
+
entry: {
|
|
38
|
+
example: string;
|
|
39
|
+
index?: undefined;
|
|
40
|
+
};
|
|
41
|
+
target: string;
|
|
42
|
+
devtool: string;
|
|
43
|
+
cache: {
|
|
44
|
+
type: string;
|
|
45
|
+
cacheDirectory: string;
|
|
46
|
+
};
|
|
47
|
+
watchOptions: {
|
|
48
|
+
poll: number;
|
|
49
|
+
};
|
|
50
|
+
output: {
|
|
51
|
+
path: string;
|
|
52
|
+
filename: string;
|
|
53
|
+
library?: undefined;
|
|
54
|
+
};
|
|
55
|
+
resolve: {
|
|
56
|
+
extensions: string[];
|
|
57
|
+
plugins: TsconfigPathsPlugin[];
|
|
58
|
+
};
|
|
59
|
+
module: {
|
|
60
|
+
rules: {
|
|
61
|
+
test: RegExp;
|
|
62
|
+
use: string;
|
|
63
|
+
exclude: RegExp;
|
|
64
|
+
}[];
|
|
65
|
+
};
|
|
66
|
+
externals?: undefined;
|
|
67
|
+
})[];
|
|
68
|
+
export = _exports;
|
|
69
|
+
import { TsconfigPathsPlugin } from "tsconfig-paths-webpack-plugin";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@koeroesi86/react-reviver",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "v23.03.4329600818-main",
|
|
4
4
|
"main": "dist/package",
|
|
5
5
|
"types": "dist/index.d.ts",
|
|
6
6
|
"license": "MIT",
|
|
@@ -22,34 +22,36 @@
|
|
|
22
22
|
"generate-version": "node ./scripts/version.js"
|
|
23
23
|
},
|
|
24
24
|
"dependencies": {
|
|
25
|
-
"react": "^
|
|
25
|
+
"react": "^18.2.0"
|
|
26
26
|
},
|
|
27
27
|
"devDependencies": {
|
|
28
|
-
"@testing-library/react": "^
|
|
29
|
-
"@types/jest": "^
|
|
30
|
-
"@types/
|
|
31
|
-
"@types/
|
|
32
|
-
"@
|
|
33
|
-
"@typescript-eslint/
|
|
34
|
-
"
|
|
35
|
-
"
|
|
36
|
-
"eslint
|
|
37
|
-
"eslint-config-
|
|
38
|
-
"eslint-
|
|
39
|
-
"eslint-
|
|
40
|
-
"eslint-plugin-
|
|
41
|
-
"eslint-plugin-
|
|
42
|
-
"eslint-plugin-react
|
|
43
|
-
"
|
|
44
|
-
"
|
|
45
|
-
"
|
|
46
|
-
"
|
|
47
|
-
"
|
|
48
|
-
"
|
|
49
|
-
"
|
|
50
|
-
"
|
|
51
|
-
"
|
|
52
|
-
"
|
|
53
|
-
"
|
|
28
|
+
"@testing-library/react": "^14.0.0",
|
|
29
|
+
"@types/jest": "^29.4.0",
|
|
30
|
+
"@types/prop-types": "^15.7.5",
|
|
31
|
+
"@types/react": "^18.0.28",
|
|
32
|
+
"@types/uuid": "^9.0.1",
|
|
33
|
+
"@typescript-eslint/eslint-plugin": "^5.54.0",
|
|
34
|
+
"@typescript-eslint/parser": "^5.54.0",
|
|
35
|
+
"dts-bundle-generator": "^7.2.0",
|
|
36
|
+
"eslint": "^8.35.0",
|
|
37
|
+
"eslint-config-airbnb": "^19.0.4",
|
|
38
|
+
"eslint-config-prettier": "^8.6.0",
|
|
39
|
+
"eslint-import-resolver-typescript": "^3.5.3",
|
|
40
|
+
"eslint-plugin-import": "^2.27.5",
|
|
41
|
+
"eslint-plugin-jsx-a11y": "^6.7.1",
|
|
42
|
+
"eslint-plugin-react": "^7.32.2",
|
|
43
|
+
"eslint-plugin-react-hooks": "^4.6.0",
|
|
44
|
+
"jest": "^29.4.3",
|
|
45
|
+
"jest-environment-jsdom": "^29.4.3",
|
|
46
|
+
"prettier": "^2.8.4",
|
|
47
|
+
"prop-types": "^15.8.1",
|
|
48
|
+
"react-dom": "^18.2.0",
|
|
49
|
+
"ts-jest": "^29.0.5",
|
|
50
|
+
"ts-loader": "^9.4.2",
|
|
51
|
+
"tsconfig-paths-webpack-plugin": "^4.0.0",
|
|
52
|
+
"typescript": "^4.9.5",
|
|
53
|
+
"uuid": "^9.0.0",
|
|
54
|
+
"webpack": "^5.75.0",
|
|
55
|
+
"webpack-cli": "^5.0.1"
|
|
54
56
|
}
|
|
55
57
|
}
|