Dynamo Package Manager Publish Wizard
npm install @dynamods/dynamo-pm-wizard
sh
npm install
`
Running the Project
To start the development server:
`sh
npm start
`
This runs the project using Vite.
To build the project:
`sh
npm run build
`
This compiles the application and processes it for production use. bundle.js and index.html will be exported in the dist folder. Only use the index.html for Dynamo.
To clean the build directory:
`sh
npm run clean
`
Dynamo Integration
The react component is hosted inside Dynamo in a WebView2 wpf component. Due to a known limitation of 2Mb, we serve a single file injecting the resulting bundle.js inside the index.html file.
- use 'inline-bundle.js' to inject the bundle.js into the index.html. The resulting file also contains the embeddesFonts location - make sure this is well coordinated with the location on Dynamo's side
Running Tests
The project includes both unit and end-to-end tests.
To run unit tests:
`sh
npm run test:unit
`
To run all tests:
`sh
npm run test
`
Linting - ignore
To check for linting errors:
`sh
npm run lint:check
`
To automatically fix linting issues:
`sh
npm run lint:fix
`
License Compliance
This project uses Autodesk's adsk-npm-license-puller to manage dependencies.
To generate direct and transitive dependency reports:
`sh
npm run license
`
Versioning
To increment the package version (patch release):
`sh
npm run version:patch
`
Deployment - Release Process
The Package Publish Wizard is a component that is consumed in the Dynamo Desktop. The component is published internally to npm.autodesk.com, to publish a new version for the component follow these steps:
- Make sure that the latest changes are reviewed and merged to the master branch.
- Create a new release branch based on the master branch.The new release branch needs to be named using the following convention:
- Start the branch name with release/
- If it is a major release, follow it by the major numeric version and the keyword -major. Example: release/2-major
- If it is a minor release, follow it by the major versions and a variable minor version denoted by x followed by the keyword -minor. Example: release/2.x-minor
- If it is a patch release, follow it by the major, minor numeric versions and a variable patch version denoted by x followed by the keyword -patch. Example: release/2.1.x-patch
- In Jenkins, select the branch and click Build now or Build with Parameters to trigger a new build.
- After a successful build, a new npm package version will be published to the internal autodesk artifactory (npm.autodesk.com).
- A PR will be created by the build service user, post build, to merge the new version from the release branch to master. Review and merge to ensure that master is always up-to-date with the latest released version.
(Note: The version of the package depends upon the version specified in the pipeline.yml file, the version in the branch name is purely for record-keeping)
Release Types
It is mandatory to include at-least one of the release types in the branch name.
- Use patch for a new patch release (backwards-compatible bug fixes, security patches).
- Use minor for a new minor release (add functionality in a backwards-compatible manner).
- Use major for a new major release (incompatible API changes/breaking changes).
Examples:
| Branch Name | Current Version | New Version |
| --------------------- | ------------- | ------------- |
| release/4.6.x-patch | 4.6.1 | 4.6.2 |
| release/4.x-minor | 4.6.2 | 4.7.0 |
| release/5-major | 4.7.0 | 5.0.0 |
Learn more about semantic versioning
#### Package Publish Wizard - Usage
The package can be installed using npm, by running the following command:
`
npm install @dynamo/dynamo-pm-wizard@latest
`
In the above command latest can be replaced by a specific version to fetch it.
Make sure to have a .npmrc file at the root level of the project before running the above command as the package in internal, and you will need it to point your npm installation to the internal Autodesk registry.
.npmrc
`
@adsk:registry=https://npm.autodesk.com/artifactory/api/npm/autodesk-npm/
registry=https://npm.autodesk.com/artifactory/api/npm/autodesk-npm-virtual/
`
These steps ensure that the package is built and deployed correctly using the configurations defined in the pipeline.yml file.
Dependencies
$3
- React 18.3.1 - Core library for building UI components
- React Hook Form - Form validation and management
- Sass - Stylesheet preprocessor for styling
- Weave MUI Components - UI components for a consistent design system
- React-Intl - Internationalization support
#### Weave MUI Library
Weave MUI is an internal Autodesk library, thus we need to make sure to include an .npmrc file with the following content:
`
@adsk:registry=https://npm.autodesk.com/artifactory/api/npm/autodesk-npm/
registry=https://npm.autodesk.com/artifactory/api/npm/autodesk-npm-virtual/
`
Can only be used when under Autodesk environment (Autodesk computer or VPN).
$3
- Vite - Build and development server
- Jest - Testing framework
- ESLint - Linter for maintaining code quality
- TypeScript - Strongly-typed JavaScript
Contribution
To contribute to the project:
1. Clone the repository.
2. Install dependencies: npm install`