Skip to content

Commit

Permalink
Add npmpackage dependency and delegate package.json setup
Browse files Browse the repository at this point in the history
The npmpackage Python requirement was introduced to handle package.json configuration for Emscripten builds. This simplifies the code by delegating the package.json setup to the npmpackage module, reducing redundancy and maintaining cleaner logic.

Contribute to NP-637
  • Loading branch information
jellespijker committed Dec 11, 2024
1 parent 0c3209f commit 8930838
Showing 1 changed file with 2 additions and 19 deletions.
21 changes: 2 additions & 19 deletions conanfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ class CuraEngineConan(ConanFile):
exports = "LICENSE*"
settings = "os", "compiler", "build_type", "arch"
package_type = "application"
python_requires = "sentrylibrary/1.0.0@ultimaker/stable"
python_requires = "sentrylibrary/1.0.0@ultimaker/stable", "npmpackage/[>=1.0.0]@ultimaker/np_637"
python_requires_extend = "sentrylibrary.SentryLibrary"

options = {
Expand Down Expand Up @@ -205,21 +205,4 @@ def package_info(self):
self.conf_info.define_path("user.curaengine:curaengine",
os.path.join(self.package_folder, "bin", f"CuraEngine{ext}"))
if self.settings.os == "Emscripten":
package_json = {
"name": f"@ultimaker/{self.name.lower()}js",
"version": f"{str(self.version).replace('+', '-')}", # npm will otherwise 'sanitize' the version number
"description": f"JavaScript / TypeScript bindings for {self.name}, a {self.description}",
"main": "bin/CuraEngine.js",
"repository": {
"type": "git",
"url": self.url
},
"author": self.author,
"license": self.license,
"keywords": self.topics,
"files": [
"bin",
"package.json"
]
}
self.conf_info.define(f"user.{self.name.lower()}:package_json", package_json)
self.python_requires["npmpackage"].module.conf_package_json(self)

0 comments on commit 8930838

Please sign in to comment.