Skip to content

Commit

Permalink
Feat: registerFaustBlock helper (wpengine#1528)
Browse files Browse the repository at this point in the history
* Feat: registerFaustBlock helper

* Chore: Fix cli build

* Build: Fix TS build errors.

* Chore: Add changeset.

* Build: Fix compiler options for node types.

* Build: Update tsconfig.json to fix test type errors.

* Build: Fix eslint issues.

* Build: Restore original tsconfig in cli.

* Build: (faustwp-core) Fixes tests type checks.

* Chore: Changesets.

* Refactor: Use appropriate types for edit,save func
  • Loading branch information
theodesp authored Aug 11, 2023
1 parent aa4cd23 commit 176bc82
Show file tree
Hide file tree
Showing 23 changed files with 6,359 additions and 16,983 deletions.
5 changes: 5 additions & 0 deletions .changeset/good-apricots-drive.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@faustwp/core': patch
---

Chore: Fixes import order style lint error.
5 changes: 5 additions & 0 deletions .changeset/light-geckos-tickle.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@faustjs/next': patch
---

Chore: Fixes import order style lint error.
5 changes: 5 additions & 0 deletions .changeset/new-drinks-march.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@faustwp/cli': patch
---

Adds reference to parent tsconfig.json and fixes type resolution errors.
19 changes: 19 additions & 0 deletions .changeset/proud-walls-clap.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
---
'@faustwp/block-editor-utils': patch
---

Feat: Add `registerFaustBlock`` helper that wraps `edit` and `save` functions used to register new blocks in Gutenberg.

Usage:

```js
import metadata from './block.json';

import MyFirstBlock from './MyFirstBlock';
import {registerFaustBlock} from '@faustwp/block-editor-utils'

import Edit from './edit';
import save from './save';

registerFaustBlock(MyFirstBlock, {blockJson: metadata, editFn: Edit, saveFn: save})
```
3 changes: 2 additions & 1 deletion examples/next/getting-started/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@
"isolatedModules": true,
"jsx": "preserve",
"baseUrl": "./src",
"incremental": true
"incremental": true,
"typeRoots": ["node_modules/@types"]
},
"include": [
"next-env.d.ts",
Expand Down
Loading

0 comments on commit 176bc82

Please sign in to comment.