Customer Question: Publish own packages

0
Customer Question:   How can I publish my own package and what do I have to think of (e.g. naming the repo in the apax.yml)?   Thank you very much.
asked
3 answers
1

Hi Matthias,

 

Good question! Here are the necessary steps to transform an AX-library into an npm package on Github.

 

  • Ensure that the project you are working on in SIMATIC AX is of type lib:
type : lib

 

 

  • In the SIMATIC AX project, add your registry to the apax.yml file:
registries:
"@<accountname>": 'https://npm.pkg.github.com'

 

  • Add the same account name before the library name in the apax.yml file:
name: "@<accountname>/example-library-name"

 

  • Choose which files should be shipped with the library in the apax.yml file:
#Files, which will be shipped with the library
files:
- bin #to ship compiled files
- src #to ship source files

 

  • Run the following commands:
apax build
apax pack

 

  • Execute the apax login command and use the arrows to move to Custom NPM registries from apax.yml and catalogs and press enter. Leave the username field empty and press enter; in the password or token field, enter the previously created GitHub token.

apaxlogin.png

 

  • Run the following command:
apax publish --package <name-of-the-generated-filex.x.x.apax.tgz> --registry https://npm.pkg.github.com

 

  • Go to your GitHub account, profile picture in the top right --> Your repositories --> Packages tab. Verify that the package has been published; change its visibility from Private to Public in Package settings.

github1.png

 

github2.png

 

 

The library is now available as a package! If you want to use this package in a new project:

 

  • Add your registry to the apax.yml file:
registries:
'@<accountname>': 'https://npm.pkg.github.com'

 

  • Login to GitHub using the apax login command. Important: for correct GitHub login, you need to enter the previously created token!

 

  • Add the package running the command:
apax add @<username>/<libraryname>

 

I hope you find this useful! If you need any clarification, I'm here to help!

 

Greetings,

Benedetta

 

answered
6

Hello Matthias Schulz,

 

Please check below question if that will help.

 

Mendix Community - Question Details

 

Mendix Community - Question Details

 

Mendix Community - Question Details

 

Create Deployment Package | Mendix Documentation

answered
1

Hi matthia

          

check this onehttps://community.mendix.com/link/space/simatic-ax/questions/143526

answered