From c52623e14395456667371d7faebb2a382c6b1b6d Mon Sep 17 00:00:00 2001 From: Iago Calazans Date: Tue, 27 Sep 2022 16:39:08 -0300 Subject: [PATCH 1/4] fix: init invalid assignment of current prop On building with TS it throws the following errors: - TS2540: Cannot assign to 'current' because it is a read-only property. - TS2721: Cannot invoke an object which is possibly 'null'. --- .../files/ts/plugin/admin/src/components/Initializer/index.tsx | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/packages/generators/generators/lib/files/ts/plugin/admin/src/components/Initializer/index.tsx b/packages/generators/generators/lib/files/ts/plugin/admin/src/components/Initializer/index.tsx index 09d4a346f5..e2e8a93cc5 100644 --- a/packages/generators/generators/lib/files/ts/plugin/admin/src/components/Initializer/index.tsx +++ b/packages/generators/generators/lib/files/ts/plugin/admin/src/components/Initializer/index.tsx @@ -12,8 +12,7 @@ type InitializerProps = { }; const Initializer: React.FC = ({ setPlugin }) => { - const ref = useRef<(id: string) => void | null>(null); - ref.current = setPlugin; + const ref = useRef<(id: string) => void | null>(setPlugin); useEffect(() => { ref.current(pluginId); From 4c0d3d296001c2f92bca12316cc5c6f2973c6f77 Mon Sep 17 00:00:00 2001 From: Oscar Dominguez Date: Sat, 1 Oct 2022 19:55:37 +0200 Subject: [PATCH 2/4] ci(checks.yml): update actions/checkout to v3 --- .github/workflows/checks.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/checks.yml b/.github/workflows/checks.yml index 2fe3c763ea..6671ef0b56 100644 --- a/.github/workflows/checks.yml +++ b/.github/workflows/checks.yml @@ -15,7 +15,7 @@ jobs: check-pr-status: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - uses: ./.github/actions/check-pr-status security-lockfile-analysis: runs-on: ubuntu-latest From 6fa840fd9a98d6520a0e868b0becf27616e5b6ed Mon Sep 17 00:00:00 2001 From: Iago Calazans Date: Mon, 3 Oct 2022 09:08:43 -0300 Subject: [PATCH 3/4] Update packages/generators/generators/lib/files/ts/plugin/admin/src/components/Initializer/index.tsx Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com> --- .../files/ts/plugin/admin/src/components/Initializer/index.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/generators/generators/lib/files/ts/plugin/admin/src/components/Initializer/index.tsx b/packages/generators/generators/lib/files/ts/plugin/admin/src/components/Initializer/index.tsx index e2e8a93cc5..5e1896e380 100644 --- a/packages/generators/generators/lib/files/ts/plugin/admin/src/components/Initializer/index.tsx +++ b/packages/generators/generators/lib/files/ts/plugin/admin/src/components/Initializer/index.tsx @@ -11,7 +11,7 @@ type InitializerProps = { setPlugin: (id: string) => void; }; -const Initializer: React.FC = ({ setPlugin }) => { +const Initializer = ({ setPlugin }: InitializerProps) => { const ref = useRef<(id: string) => void | null>(setPlugin); useEffect(() => { From db785ab59f8a4bfeff5be613f260139b118d8ef9 Mon Sep 17 00:00:00 2001 From: Iago Calazans Date: Mon, 3 Oct 2022 09:08:52 -0300 Subject: [PATCH 4/4] Update packages/generators/generators/lib/files/ts/plugin/admin/src/components/Initializer/index.tsx Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com> --- .../files/ts/plugin/admin/src/components/Initializer/index.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/generators/generators/lib/files/ts/plugin/admin/src/components/Initializer/index.tsx b/packages/generators/generators/lib/files/ts/plugin/admin/src/components/Initializer/index.tsx index 5e1896e380..7f4d42aa2f 100644 --- a/packages/generators/generators/lib/files/ts/plugin/admin/src/components/Initializer/index.tsx +++ b/packages/generators/generators/lib/files/ts/plugin/admin/src/components/Initializer/index.tsx @@ -12,7 +12,7 @@ type InitializerProps = { }; const Initializer = ({ setPlugin }: InitializerProps) => { - const ref = useRef<(id: string) => void | null>(setPlugin); + const ref = useRef(setPlugin); useEffect(() => { ref.current(pluginId);