mirror of
https://github.com/elastic/kibana.git
synced 2025-06-27 10:40:07 -04:00
[pkgs/peggy] automatically transform peggy files with babel-register and webpack (#145615)
In order to get us closer to the developer experience we want for packages, we are trying to move package builds out of bazel and instead we want to build files on demand. In the case of .peggy files this means importing them directly and teaching babel/jest/webpack how to handle these imports by automatically transpiling and caching the results. This change does just that, adding a `@kbn/peggy` package which wraps peggy for types, and also adds support for defining peggy config adjacent to a peggy grammar file in a `${basename}.config.json` file. This file will be parsed and used to configure things like `allowedStartRules` as described in [the peggy docs](https://peggyjs.org/documentation.html#generating-a-parser-javascript-api). This PR also implements `@kbn/peggy-loader` which uses `@kbn/peggy` to transpile peggy files in webpack, and a peggy transform for both Jest and our custom babel register hook. Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
This commit is contained in:
parent
cffaa60bd1
commit
cfdb8553ba
70 changed files with 1245 additions and 282 deletions
|
@ -64,6 +64,7 @@ layout: landing
|
|||
{ pageId: "kibDevDocsOpsExpect" },
|
||||
{ pageId: "kibDevDocsOpsAmbientStorybookTypes" },
|
||||
{ pageId: "kibDevDocsOpsAmbientUiTypes" },
|
||||
{ pageId: "kibDevDocsOpsAmbientCommonTypes" },
|
||||
{ pageId: "kibDevDocsOpsTestSubjSelector" },
|
||||
{ pageId: "kibDevDocsOpsBazelRunner" },
|
||||
{ pageId: "kibDevDocsOpsCliDevMode" },
|
||||
|
@ -77,5 +78,7 @@ layout: landing
|
|||
{ pageId: "kibDevDocsOpsManagedVscodeConfigCli" },
|
||||
{ pageId: "kibDevDocsOpsTest" },
|
||||
{ pageId: "kibDevDocsOpsEsArchiver" },
|
||||
{ pageId: "kibDevDocsOpsPeggy" },
|
||||
{ pageId: "kibDevDocsOpsPeggyLoader" },
|
||||
]}
|
||||
/>
|
Loading…
Add table
Add a link
Reference in a new issue