The Australian Government coat of Arms

Communities of practice

Communities of practice

Ability to implement non gov.au organisation pancake modules in with gov.au pancake modules


#1

Hi,

I was just wondering if there was a way to implement our own npm organisation pancake modules in the automated pancake build process with the existing gov.au npm organisation modules

Cheers,
B


#2

Great question @bayleymauger, I think we need to write some more advanced articles around pancake as there is a lot of missing information.

Pancake is pretty flexible and you can definitely make your own npm modules and use pancake. Have a look at our scaffolding we use for our components:

In the package.json file you can see that on postinstall it runs pancake. The pancake-module object also tells pancake where the files are located, so make sure you follow a similar pattern.

For disclousure, I have not actually built any external npm modules for pancake. That being said we have created test modules that should give you some additional guidance.

I would love to know if you experience any issues or have any feedback.


If you are building new components and have code snippets or works in progress we would love you to share them as we may be able to deploy alpha versions of these components to @gov.au/.


#3

Hi @alex.page,

We are trying to build our own variations of certain components from the design system.
e.g. @digital.nsw/header, @digital.nsw/footer etc…

Currently when using pancake from my observation you can only use npm modules from one npm organisation. We were wondering if there was any way to include the @digital.nsw modules into the postinstall script with @gov.au modules without having either organisation overwrite the other.

Thanks,
B


#4

@bayleymauger Do you have a published version somewhere I can install and try out?


#5

@alex.page Nothing published yet, I can send you over some source code of a semi-finished module and just use npm pack and try install the package that way


#6

Sounds good!


#8

I have opened an issue to investigate this, as the original creator of pancake is no longer at the DTA.


#9

I think it is possible if you are very careful not to include two cores or anything like that.

The default setting npmOrgs should be made a list https://github.com/govau/pancake/blob/21d154d17aef148c74ad0d7072c02a898cf75a4b/packages/pancake/settings.json

Then you could search multiple folders to compile all the pancake candidate npm packages (like I already had to do to support yarn monorepos) https://github.com/govau/pancake/blob/74492f55be2d68ce3b013ea7a497c833efca0680/packages/pancake/src/modules.js#L85